Skip to content

Commit 05d6db2

Browse files
locallycompactch1bo
authored andcommitted
Replace hlint shell job with check derivation.
1 parent 477fb4d commit 05d6db2

File tree

4 files changed

+54
-5
lines changed

4 files changed

+54
-5
lines changed

.github/workflows/formatting.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ jobs:
3030
3131
- name: 📐 Check hlint
3232
run: |
33-
nix develop .#fmt --command hlint .
33+
nix build .#checks.x86_64-linux.hlint

flake.lock

Lines changed: 38 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
haskellNix.url = "github:input-output-hk/haskell.nix";
55
iohk-nix.url = "github:input-output-hk/iohk-nix";
66
flake-utils.url = "github:numtide/flake-utils";
7+
lint-utils = {
8+
url = "github:homotopic/lint-utils";
9+
inputs.nixpkgs.follows = "haskellNix/nixpkgs";
10+
};
711
CHaP = {
812
url = "github:input-output-hk/cardano-haskell-packages?ref=repo";
913
flake = false;
@@ -33,6 +37,9 @@
3337
(system:
3438
let
3539
pkgs = import inputs.nixpkgs { inherit system; };
40+
tools = {
41+
hlint = hydraProject.pkgs.haskell-nix.tool hydraProject.compiler "hlint" "3.8";
42+
};
3643
hydraProject = import ./nix/hydra/project.nix {
3744
inherit (inputs) haskellNix iohk-nix CHaP;
3845
inherit system nixpkgs;
@@ -58,8 +65,12 @@
5865
spec = import ./spec { inherit pkgs; };
5966
};
6067

68+
checks = let lu = inputs.lint-utils.linters.${system}; in {
69+
hlint = lu.hlint { src = self; hlint = tools.hlint; };
70+
};
71+
6172
devShells = (import ./nix/hydra/shell.nix {
62-
inherit inputs hydraProject system;
73+
inherit inputs hydraProject tools system;
6374
}) // {
6475
ci = (import ./nix/hydra/shell.nix {
6576
inherit inputs hydraProject system;

nix/hydra/shell.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
withoutDevTools ? false
88
, hydraProject
99
, inputs
10+
, tools
1011
, system ? builtins.currentSystem
1112
}:
1213
let
@@ -16,7 +17,6 @@ let
1617

1718
fourmolu = pkgs.haskell-nix.tool compiler "fourmolu" "0.14.0.0";
1819
cabal-fmt = pkgs.haskell-nix.tool compiler "cabal-fmt" "0.1.9";
19-
hlint = pkgs.haskell-nix.tool compiler "hlint" "3.8";
2020
apply-refact = pkgs.haskell-nix.tool compiler "apply-refact" "0.14.0.0";
2121

2222
# Build HLS form our fork (see flake.nix)
@@ -47,7 +47,7 @@ let
4747
fourmolu
4848
cabal-fmt
4949
pkgs.nixpkgs-fmt
50-
hlint
50+
tools.hlint
5151
apply-refact
5252
# For validating JSON instances against a pre-defined schema
5353
pkgs.check-jsonschema
@@ -159,7 +159,7 @@ let
159159
fourmolu
160160
cabal-fmt
161161
pkgs.nixpkgs-fmt
162-
hlint
162+
tools.hlint
163163
apply-refact
164164
];
165165
};

0 commit comments

Comments
 (0)