-
Notifications
You must be signed in to change notification settings - Fork 25
nix: Add alejandra, prettify and cabal-gild git hook #985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
5ae5a90 to
e659469
Compare
There was a problem hiding this 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
e753b4b to
04c4a4e
Compare
04c4a4e to
3dc1a11
Compare
There was a problem hiding this 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$"; | ||
| }; |
There was a problem hiding this comment.
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
Changelog
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