[feature] stylish-haskell as a pre-commit hook#481
Open
LucBro wants to merge 1 commit intohaskell:mainfrom
Open
[feature] stylish-haskell as a pre-commit hook#481LucBro wants to merge 1 commit intohaskell:mainfrom
LucBro wants to merge 1 commit intohaskell:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello,
i've tried to add pre-commit support for users of stylish-haskell.
You can test it, by
Exampleoutside thestylish-haskellrepocd Examplegit initexample/Bad.hsfrom the stylish-haskell repo to your folderExamplegit add Bad.hsgit commit -m "initial commit"pre-commit try-repo your/local/path/to/repo/stylish-haskell/ --all-filesBad.hsshould be formatted nowEDIT:
additional:
.pre-commit-config.yamlin the repoExamplewith:Bad.hs/EDIT
Be aware that the
try-repocommand ofpre-commitworks with HEAD of the local stylish-haskell repo, so commit your changes of.pre-commit-hooks.yaml.The
--all-filesargument ensures that yourBad.hsis not skipped (and that's the reason why I don't use the command instylish-haskell/examples, as it would change every.hsfile in the repo).Pre-commit uses
cabalto install stylish-haskell. I've tested this with ghc 9.8.2 andcabal 3.10.3.0.
People should be able to use now
stylish-haskellin pre-commit by adding this to their.pre-commit-config.yamland runningpre-commit run --all-filesor committing in their haskell project repo.Thank you
Greetings
LucBro