Skip to content

Commit 44d8867

Browse files
authored
Nixify hlint (#1293)
I accidentally introduced an hlint failure in #1292, which got merged as the job is not marked as required. This PR resolves this by adding it to the Hydra jobset.
2 parents e38e8e2 + 9467a75 commit 44d8867

File tree

6 files changed

+20
-43
lines changed

6 files changed

+20
-43
lines changed

.github/workflows/hlint.yml

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

nix/ci.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ let
3939
native = {
4040
haskell96 = mkHaskellJobsFor pkgs.hsPkgs;
4141
} // lib.optionalAttrs (buildSystem == "x86_64-linux") {
42-
formatting = import ./formatting.nix pkgs;
42+
formattingLinting = import ./formatting-linting.nix pkgs;
4343
inherit (pkgs) consensus-pdfs agda-spec;
4444

4545
# ensure we can still build on 8.10, can be removed soon
Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,29 @@ let
2424
echo $EXIT_CODE > $out
2525
fi
2626
'';
27-
formatting = {
27+
formattingLinting = {
2828
stylish = checkFormatting pkgs.stylish-haskell ../scripts/ci/run-stylish.sh;
2929
cabal-gild = checkFormatting pkgs.cabal-gild ../scripts/ci/run-cabal-gild.sh;
3030
nixpkgs-fmt = checkFormatting pkgs.nixpkgs-fmt ../scripts/ci/run-nixpkgs-fmt.sh;
3131
dos2unix = checkFormatting pkgs.dos2unix ../scripts/ci/run-dos2unix.sh;
32+
hlint = pkgs.runCommand "hlint"
33+
{
34+
buildInputs = [ pkgs.hlint ];
35+
src = ../.;
36+
} ''
37+
unpackPhase
38+
cd $sourceRoot
39+
40+
hlint -j .
41+
42+
touch $out
43+
'';
3244
};
3345
in
34-
formatting // {
46+
formattingLinting // {
3547
all = pkgs.releaseTools.aggregate {
3648
name = "consensus-formatting";
37-
meta.description = "Run all formatters";
38-
constituents = lib.collect lib.isDerivation formatting;
49+
meta.description = "Run all formatters and linters";
50+
constituents = lib.collect lib.isDerivation formattingLinting;
3951
};
4052
}

nix/shell.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ hsPkgs.shellFor {
1212
pkgs.stylish-haskell
1313
pkgs.dos2unix
1414
pkgs.cabal-gild
15+
pkgs.hlint
1516
pkgs.cabal-hoogle
1617
pkgs.ghcid
1718

nix/tools.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ in
3535

3636
cabal-gild = tool "cabal-gild" "1.5.0.1" { };
3737

38+
hlint = tool "hlint" "3.8" { };
39+
3840
haskellBuildUtils = prev.haskellBuildUtils.override {
3941
inherit (final.hsPkgs.args) compiler-nix-name;
4042
index-state = tool-index-state;

ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Node/DiffusionPipelining.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
{-# LANGUAGE FlexibleContexts #-}
66
{-# LANGUAGE ScopedTypeVariables #-}
77
{-# LANGUAGE StandaloneDeriving #-}
8-
{-# LANGUAGE TypeApplications #-}
98
{-# LANGUAGE TypeFamilies #-}
109
{-# LANGUAGE UndecidableInstances #-}
1110

0 commit comments

Comments
 (0)