Skip to content

Commit

Permalink
Replace hlint shell job with check derivation.
Browse files Browse the repository at this point in the history
  • Loading branch information
locallycompact committed Feb 20, 2024
1 parent 4463d6f commit 063d931
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/formatting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ jobs:
- name: 📐 Check hlint
run: |
nix develop .#fmt --command hlint .
nix build .#checks.x86_64-linux.hlint
38 changes: 38 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
haskellNix.url = "github:input-output-hk/haskell.nix";
iohk-nix.url = "github:input-output-hk/iohk-nix";
flake-utils.url = "github:numtide/flake-utils";
lint-utils = {
url = "github:homotopic/lint-utils";
inputs.nixpkgs.follows = "haskellNix/nixpkgs";
};
CHaP = {
url = "github:input-output-hk/cardano-haskell-packages?ref=repo";
flake = false;
Expand Down Expand Up @@ -33,6 +37,9 @@
(system:
let
pkgs = import inputs.nixpkgs { inherit system; };
tools = {
hlint = hydraProject.pkgs.haskell-nix.tool hydraProject.compiler "hlint" "3.8";
};
hydraProject = import ./nix/hydra/project.nix {
inherit (inputs) haskellNix iohk-nix CHaP;
inherit system nixpkgs;
Expand All @@ -58,8 +65,12 @@
spec = import ./spec { inherit pkgs; };
};

checks = let lu = inputs.lint-utils.linters.${system}; in {
hlint = lu.hlint { src = self; hlint = tools.hlint; };
};

devShells = (import ./nix/hydra/shell.nix {
inherit inputs hydraProject system;
inherit inputs hydraProject tools system;
}) // {
ci = (import ./nix/hydra/shell.nix {
inherit inputs hydraProject system;
Expand Down
6 changes: 3 additions & 3 deletions nix/hydra/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
withoutDevTools ? false
, hydraProject
, inputs
, tools
, system ? builtins.currentSystem
}:
let
Expand All @@ -16,7 +17,6 @@ let

fourmolu = pkgs.haskell-nix.tool compiler "fourmolu" "0.14.0.0";
cabal-fmt = pkgs.haskell-nix.tool compiler "cabal-fmt" "0.1.9";
hlint = pkgs.haskell-nix.tool compiler "hlint" "3.8";
apply-refact = pkgs.haskell-nix.tool compiler "apply-refact" "0.14.0.0";

# Build HLS form our fork (see flake.nix)
Expand Down Expand Up @@ -47,7 +47,7 @@ let
fourmolu
cabal-fmt
pkgs.nixpkgs-fmt
hlint
tools.hlint
apply-refact
# For validating JSON instances against a pre-defined schema
pkgs.check-jsonschema
Expand Down Expand Up @@ -159,7 +159,7 @@ let
fourmolu
cabal-fmt
pkgs.nixpkgs-fmt
hlint
tools.hlint
apply-refact
];
};
Expand Down

0 comments on commit 063d931

Please sign in to comment.