Skip to content

Commit

Permalink
Merge pull request #89 from georgefst/master
Browse files Browse the repository at this point in the history
Add Fourmolu (Haskell formatter)
  • Loading branch information
domenkozar authored Dec 29, 2020
2 parents a3cfabb + 908bbd6 commit ac3a4ca
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ eval "$shellHook"
## Haskell

- [ormolu](https://github.com/tweag/ormolu)
- [fourmolu](https://github.com/parsonsmatt/fourmolu)
- [hindent](https://github.com/chrisdone/hindent)
- [stylish-haskell](https://github.com/jaspervdj/stylish-haskell)
- [hlint](https://github.com/ndmitchell/hlint)
Expand Down
10 changes: 10 additions & 0 deletions modules/hooks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,16 @@ in
}";
files = "\\.l?hs$";
};
fourmolu =
{
name = "fourmolu";
description = "Haskell code prettifier.";
entry =
"${tools.fourmolu}/bin/fourmolu --mode inplace ${
lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) settings.ormolu.defaultExtensions)
}";
files = "\\.l?hs$";
};
hindent =
{
name = "hindent";
Expand Down
2 changes: 1 addition & 1 deletion nix/tools.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
{
inherit ansible-lint hlint shellcheck ormolu hindent cabal-fmt nixpkgs-fmt nixfmt nix-linter rustfmt clippy cargo;
inherit (elmPackages) elm-format;
inherit (haskellPackages) stylish-haskell brittany hpack;
inherit (haskellPackages) stylish-haskell brittany hpack fourmolu;
inherit (pythonPackages) yamllint;
inherit (nodePackages) prettier;
purty = callPackage ./purty { purty = nodePackages.purty; };
Expand Down

0 comments on commit ac3a4ca

Please sign in to comment.