stylish-haskell icon indicating copy to clipboard operation
stylish-haskell copied to clipboard

Give useful error message when using `exit_code: error_on_format`

Open tysonzero opened this issue 2 years ago • 2 comments

This would allow for nicer CI integration. As it stands it's easy to get the CI to fail when the code isn't styled correctly, but it's rather hard to actually know what the reason is.

tysonzero avatar Apr 14 '22 09:04 tysonzero

Can you give an example?

EncodePanda avatar Apr 14 '22 09:04 EncodePanda

Currently running stylish-haskell -r src with exit_code: error_on_format spits out all the corrected source code, which is not ideal for a human looking through the CI failure log.

The absolute ideal would be something like what hlint outputs, with a human readable description of what is incorrectly formatted. However if the code architecture makes that impractical, then a git-style diff of the file changes would be easy to work with as well.

tysonzero avatar Apr 14 '22 19:04 tysonzero