10. Linting

10.1. HLint

To run HLint you need it’s binary, e.g. by executing:

nix-shell -p hlint

To run it on the whole project (Warning: This takes a long time!):

hlint .

To run it on a sub-project:

hlint services/federator

10.2. Stan

To run Stan, you need it’s binary compiled by the same GHC version as used in the project.

nix-shell -p haskell.packages.ghc884.stan

Stan depends on hie database files that are created during compilation. To generate them for all packages add this to your cabal.project.local file:

package *
    ghc-options: -fwrite-ide-info -hiedir=.hie

Of course, you can append the ghc-options to the respective entry of a package or add a new one:

package cargohold
    ghc-options: -fwrite-ide-info -hiedir=.hie

To analyze a sub-project with stan:

cd services/cargohold