Skip to content

Commit 86d0c3b

Browse files
committed
nix: deny unused lint group in dedicated flake check
Catches stale #[allow(dead_code)] annotations when the code they guard becomes live.
1 parent 62bcbc8 commit 86d0c3b

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

nix/checks.nix

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,19 @@
7474
}
7575
);
7676

77+
unused-lints = toolchains.nightly.mkCargoDerivation (
78+
commonArgs
79+
// {
80+
cargoArtifacts = cargoArtifactsDev;
81+
CARGO_PROFILE = "dev";
82+
pnameSuffix = "-unused-lints";
83+
buildPhaseCargoCommand = ''
84+
RUSTFLAGS="''${RUSTFLAGS:-} -D unused" cargo check --all-targets --all-features
85+
'';
86+
installPhase = "mkdir -p $out";
87+
}
88+
);
89+
7790
no-todo-comments = pkgs.runCommand "no-todo-comments-${rev}" { inherit src; } ''
7891
if grep -rn --exclude-dir=contrib 'TO[D]O\|FIX[M]E' $src/ 2>/dev/null; then
7992
echo "FAIL: unresolved work-item markers found"
@@ -96,6 +109,7 @@
96109
name = "lint-checks";
97110
paths = [
98111
checks.clippy
112+
checks.unused-lints
99113
checks.no-todo-comments
100114
];
101115
};

0 commit comments

Comments
 (0)