Hstyle is a project mainly written in Haskell, based on the BSD-3-Clause license.
A Haskell style checker
hstyle
is a customizable code style checker for Haskell programs.
cabal install hstyle
hstyle --help
Currently, we have a framework which allows developers to write rules for a
certain codestyle. Some examples of these rules can be found in
src/HStyle/Rules
.
We have:
Overall, we don't consider it ready for production use.
Crazy {- ... -}
comments can confuse the style checker. E.g.
fib :: Int
-> {- -> -} Int
fib 0 = 1
fib n = fib (n - 1) + fib (n - 2)
But I guess that's not the way you want to write code if you want to adhere to any style guide out there.
...is currently not supported. It should not be too hard to implement.
This is probably due to a bug(?) in haskell-src-exts
, as the hlint
tool runs
into the same problem.
Apart from an executable, the cabal file also provides a library, which can be
used to customize hstyle
.
HStyle.Main.mainWith
, supplying your custom
ruleset.In the future we hope to build more sophisticated checking. The ultimate goal would be an automatic reformatter that generates gorgeous code -- but that's a hard problem.