Skip to content

Commit 1dc7b2a

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 e85270b commit 1dc7b2a

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
@@ -89,6 +89,19 @@
8989
}
9090
);
9191

92+
unused-lints = toolchains.nightly.mkCargoDerivation (
93+
commonArgs
94+
// {
95+
cargoArtifacts = cargoArtifactsDev;
96+
CARGO_PROFILE = "dev";
97+
pnameSuffix = "-unused-lints";
98+
buildPhaseCargoCommand = ''
99+
RUSTFLAGS="''${RUSTFLAGS:-} -D unused" cargo check --all-targets --all-features
100+
'';
101+
installPhase = "mkdir -p $out";
102+
}
103+
);
104+
92105
no-todo-comments = pkgs.runCommand "no-todo-comments-${rev}" { inherit src; } ''
93106
if grep -rn --exclude-dir=contrib 'TO[D]O\|FIX[M]E' $src/ 2>/dev/null; then
94107
echo "FAIL: unresolved work-item markers found"
@@ -112,6 +125,7 @@
112125
paths = [
113126
checks.clippy
114127
checks.doc
128+
checks.unused-lints
115129
checks.no-todo-comments
116130
];
117131
};

0 commit comments

Comments
 (0)