tweag / ormolu

A formatter for Haskell source code
https://ormolu-live.tweag.io
Other
958 stars 83 forks source link

Add style guide check + preview of differences #664

Closed troibe closed 3 years ago

troibe commented 3 years ago

Is your feature request related to a problem? Please describe. I would like to use ormolu in a git action to check if the code complies with the style guide.

Describe the solution you'd like Maybe I didn't find it in the documentation but is there a mode that just checks if the style guide is met and returns the parts of the code where there would be differences?

Describe alternatives you've considered Of course I can just execute the formatter and then compare unformatted and formatted file but it would be nice to have this functionality build in.

mrkkrp commented 3 years ago

Indeed, this is something I'd like to have too. The suggested edits should be printed to stderr in check mode, right now we just return non-zero exit code if the inputs are not already formatted.

mrkkrp commented 3 years ago

Duplicate of #656.