Skip to content

Commit c55dbf7

Browse files
hydra-coding-standards: 0.6.0 (#2041)
Moves typos check upstream. Adds deadnix check and formatter for nix dead code elimination.
1 parent 8e3e23b commit c55dbf7

File tree

9 files changed

+23
-37
lines changed

9 files changed

+23
-37
lines changed

flake.lock

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

flake.nix

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
cardano-node.url = "github:intersectmbo/cardano-node/10.1.4";
99
flake-parts.url = "github:hercules-ci/flake-parts";
1010
haskellNix.url = "github:input-output-hk/haskell.nix";
11-
hydra-coding-standards.url = "github:cardano-scaling/hydra-coding-standards/0.5.0";
11+
hydra-coding-standards.url = "github:cardano-scaling/hydra-coding-standards/0.6.0";
1212
hydra-spec.url = "github:cardano-scaling/hydra-formal-specification";
1313
iohk-nix.url = "github:input-output-hk/iohk-nix";
1414
lint-utils = {
@@ -36,7 +36,7 @@
3636
"aarch64-darwin"
3737
"aarch64-linux"
3838
];
39-
perSystem = { pkgs, config, lib, system, ... }:
39+
perSystem = { config, lib, system, ... }:
4040
let
4141
compiler = "ghc966";
4242

@@ -59,20 +59,20 @@
5959
(import ./nix/static-libs.nix)
6060
inputs.nix-npm-buildpackage.overlays.default
6161
# Specific versions of tools we require
62-
(final: prev: {
62+
(final: _prev: {
6363
inherit (inputs.aiken.packages.${system}) aiken;
64-
apply-refact = pkgs.haskell-nix.tool compiler "apply-refact" "0.15.0.0";
65-
cabal-install = pkgs.haskell-nix.tool compiler "cabal-install" "3.10.3.0";
66-
cabal-plan = pkgs.haskell-nix.tool compiler "cabal-plan" "0.7.5.0";
64+
apply-refact = final.haskell-nix.tool compiler "apply-refact" "0.15.0.0";
65+
cabal-install = final.haskell-nix.tool compiler "cabal-install" "3.10.3.0";
66+
cabal-plan = final.haskell-nix.tool compiler "cabal-plan" "0.7.5.0";
6767
cabal-fmt = config.treefmt.programs.cabal-fmt.package;
6868
fourmolu = config.treefmt.programs.fourmolu.package;
69-
haskell-language-server = pkgs.haskell-nix.tool compiler "haskell-language-server" "2.9.0.0";
70-
weeder = pkgs.haskell-nix.tool compiler "weeder" "2.9.0";
69+
haskell-language-server = final.haskell-nix.tool compiler "haskell-language-server" "2.9.0.0";
70+
weeder = final.haskell-nix.tool compiler "weeder" "2.9.0";
7171
inherit (inputs.cardano-node.packages.${system}) cardano-cli;
7272
inherit (inputs.cardano-node.packages.${system}) cardano-node;
7373
inherit (inputs.mithril.packages.${system}) mithril-client-cli;
7474
mithril-client-cli-unstable =
75-
pkgs.writeShellScriptBin "mithril-client-unstable" ''
75+
final.writeShellScriptBin "mithril-client-unstable" ''
7676
exec ${inputs.mithril-unstable.packages.${system}.mithril-client-cli}/bin/mithril-client "$@"
7777
'';
7878
})
@@ -92,9 +92,6 @@
9292
};
9393

9494
tx-cost-diff =
95-
let
96-
pyEnv = pkgs.python3.withPackages (ps: with ps; [ pandas html5lib beautifulsoup4 tabulate ]);
97-
in
9895
pkgs.writers.writeHaskellBin
9996
"tx-cost-diff"
10097
{
@@ -122,14 +119,6 @@
122119
inherit tx-cost-diff;
123120
};
124121

125-
treefmt.programs.typos = {
126-
enable = true;
127-
includes = [
128-
"*.md"
129-
"*.hs"
130-
"*.cabal"
131-
];
132-
};
133122
coding.standards.hydra = {
134123
enable = true;
135124
haskellPackages = with hsPkgs; builtins.concatMap allComponents [

nix/hydra/demo.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# A demo using process-compose
2-
{ inputs, self, ... }:
2+
{ self, ... }:
33
{
44

55
perSystem = { pkgs, self', ... }:

nix/hydra/packages.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
{ hsPkgs # as defined in default.nix
44
, pkgs
5-
, inputs
65
, gitRev ? "unknown"
7-
, self
6+
, ...
87
}:
98
let
109
inherit (pkgs) lib;

nix/hydra/project.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pkgs.haskell-nix.project {
1010
src = pkgs.haskell-nix.haskellLib.cleanSourceWith {
1111
name = "hydra";
1212
src = ./../..;
13-
filter = path: type:
13+
filter = path: _type:
1414
# Blacklist of paths which do not affect the haskell build. The smaller
1515
# the resulting list of files is, the less likely we have redundant
1616
# rebuilds.

nix/static-libs.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Overlay vendored from https://github.com/input-output-hk/haskell-nix-example/blob/2247d445b91b0cc21eda4359e060d76b3cc0ce41/flake.nix#L53C17-L53C17
2-
final: prev: {
2+
final: _prev: {
33
static-libsodium-vrf = final.libsodium-vrf.overrideDerivation (old: {
44
configureFlags = old.configureFlags ++ [ "--disable-shared" ];
55
});
@@ -9,14 +9,14 @@ final: prev: {
99
static-gmp = (final.gmp.override { withStatic = true; }).overrideDerivation (old: {
1010
configureFlags = old.configureFlags ++ [ "--enable-static" "--disable-shared" ];
1111
});
12-
static-libblst = (final.libblst.override { enableShared = false; }).overrideDerivation (old: {
12+
static-libblst = (final.libblst.override { enableShared = false; }).overrideDerivation (_old: {
1313
postFixup = "";
1414
});
1515
static-openssl = final.openssl.override { static = true; };
1616
static-zlib = final.zlib.override { shared = false; };
1717
static-pcre = final.pcre.override { shared = false; };
1818
# XXX: Not replicate the cmakeFlags but just drop the -DBUILD_SHARED_LIBS=ON from it
19-
static-snappy = final.snappy.overrideDerivation (old: {
19+
static-snappy = final.snappy.overrideDerivation (_old: {
2020
cmakeFlags = [ "-DSNAPPY_BUILD_TESTS=OFF" "-DSNAPPY_BUILD_BENCHMARKS=OFF" ];
2121
});
2222
}

sample-node-config/another-nixos/configuration.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
{ config
2-
, pkgs
1+
{ pkgs
32
, lib
43
, system
54
, cardano-node

sample-node-config/another-nixos/flake.nix

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@
1313

1414

1515
outputs =
16-
{ self
17-
, nixpkgs
16+
{ nixpkgs
1817
, nixos-generators
1918
, cardano-node
2019
, hydra
2120
, mithril
2221
, ...
23-
}@inputs:
22+
}:
2423
let
2524
system = "x86_64-linux";
2625
in

sample-node-config/nixos/hydraw.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Hydraw running on hydra running on cardano
22

3-
{ config, pkgs, lib, ... }:
3+
{ pkgs, ... }:
44

55
let
66
cardano-node = import

0 commit comments

Comments
 (0)