Skip to content

Commit 2482c4f

Browse files
committed
Add pre-commit hooks
1 parent b8a92a5 commit 2482c4f

File tree

4 files changed

+8
-245
lines changed

4 files changed

+8
-245
lines changed

flake.nix

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
66
flake-utils.url = "github:numtide/flake-utils";
77
flake-compat = {
8-
url = github:edolstra/flake-compat;
8+
url = "github:edolstra/flake-compat";
99
flake = false;
1010
};
1111
};
@@ -16,8 +16,7 @@
1616
}:
1717
flake-utils.lib.eachSystem ["x86_64-linux"] (
1818
system: let
19-
pkgs = inputs.nixpkgs.legacyPackages.${system};
20-
inherit (pkgs) lib haskellPackages haskell;
19+
inherit (inputs.nixpkgs.legacyPackages.${system}) lib haskellPackages haskell;
2120
golden-test = import ./test/golden1.nix {
2221
seed = "1";
2322
inherit system;
@@ -45,14 +44,17 @@
4544
];
4645
hooks = {
4746
hlint.enable = true;
48-
cabal-fmt.enable = true;
4947
alejandra.enable = true;
48+
nix-linter.enable = true;
49+
statix.enable = true;
5050
fourmolu.enable = true;
51+
cabal-fmt.enable = true;
52+
shellcheck.enable = true;
5153
};
5254
};
5355
};
5456
devShell = haskellPackages.shellFor {
55-
packages = p: [defaultPackage];
57+
packages = _: [defaultPackage];
5658
buildInputs = [inputs.pre-commit-hooks.defaultPackage.${system}];
5759
withHoogle = true;
5860
inherit (self.checks.${system}.pre-commit-check) shellHook;

nix/sources.json

Lines changed: 0 additions & 14 deletions
This file was deleted.

nix/sources.nix

Lines changed: 0 additions & 226 deletions
This file was deleted.

test/golden2.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ with import <nixpkgs> {}; let
2626
build2 = pkgs.runCommand "build2" {} ''
2727
sleep 3s
2828
cat ${build5}
29+
cat ${build6}
2930
cat ${build1}
3031
echo "test" > $out
3132
'';

0 commit comments

Comments
 (0)