Skip to content

Conversation

@carbolymer
Copy link
Contributor

Changelog

- description: |
    nix: Add alejandra, prettify and cabal-gild git hook
# uncomment types applicable to the change:
  type:
  # - feature        # introduces a new feature
  # - breaking       # the API has changed in a breaking way
  # - compatible     # the API has changed but is non-breaking
  # - optimisation   # measurable performance improvements
  # - refactoring    # QoL changes
  # - bugfix         # fixes a defect
  # - test           # fixes/modifies tests
   - maintenance    # not directly related to the code
  # - release        # related to a new release preparation
  # - documentation  # change in code docs, haddocks...
# uncomment at least one main project this PR is associated with
  projects:
   - cardano-api
  # - cardano-api-gen
  # - cardano-rpc
  # - cardano-wasm

Context

Additional context for the PR goes here. If the PR fixes a particular issue please provide a link to the issue.

How to trust this PR

Highlight important bits of the PR that will make the review faster. If there are commands the reviewer can run to observe the new behavior, describe them.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. See Running tests for more details
  • Self-reviewed the diff

@carbolymer carbolymer force-pushed the mgalazyn/chore/bump-ghc-add-devshell-hooks branch 3 times, most recently from 5ae5a90 to e659469 Compare October 24, 2025 14:11
Copy link
Contributor

@palas palas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was testing the hook for cabal-gild and I am getting this for a perfectly valid cardano-api.cabal file:

HasCallStack backtrace:
  collectBacktraces, called at libraries/ghc-internal/src/GHC/Internal/Exception.hs:169:13 in ghc-internal:GHC.Internal.Exception
  toExceptionWithBacktrace, called at libraries/ghc-internal/src/GHC/Internal/IO.hs:260:11 in ghc-internal:GHC.Internal.IO
  throwIO, called at libraries/ghc-internal/src/GHC/Internal/Control/Exception/Base.hs:195:43 in ghc-internal:GHC.Internal.Control.Exception.Base

So we should fix this before merging, I'll give it a go

@palas palas force-pushed the mgalazyn/chore/bump-ghc-add-devshell-hooks branch from e753b4b to 04c4a4e Compare October 24, 2025 18:04
@palas palas force-pushed the mgalazyn/chore/bump-ghc-add-devshell-hooks branch from 04c4a4e to 3dc1a11 Compare October 24, 2025 18:25
Copy link
Contributor

@palas palas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I fixed it now, and also rebased the branch

in
builtins.toString script;
files = "\\.cabal$";
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied this from https://github.com/cachix/git-hooks.nix/blob/ca5b894d3e3e151ffc1db040b6ce4dcc75d31c37/modules/hooks.nix#L2303:

I imagine it could be made simpler by modifying the package field instead of entry, but I am not sure where in the flake to get it from, and this works fine.

Another thing is that it looks like the scripts/githooks/haskell-style-lint hook, already checks this, but it is probably nicer to have it separate as it is now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants