git-hooks.nix
git-hooks.nix copied to clipboard
`stylish-haskell` "benign failures"
stylish-haskell exits 1 on files it can't deal with, with a typical example being anything containing CPP.
This is a "benign failure" in that it just means that it can't process the file. However, it has the effect of making the pre-commit hook fail.
I'm not sure quite what the right solution is:
- Swallow the
stylish-haskellexit code in the hook? Might mask some more genuine failures. - Require users to exclude such files themselves? A bit of a pain...
I excluded files for ormolu when it didn't handle them.
You could write a script that checks for CPP pragma and write a list of files to exclude in JSON and then feed that to pre-commit.