Skip to content

Commit 83e9cad

Browse files
committed
nix: cargo-sort check for Cargo.toml dependency ordering
1 parent 91ab24f commit 83e9cad

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

nix/checks.nix

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,17 @@
8989
}
9090
);
9191

92+
cargo-sort =
93+
pkgs.runCommand "cargo-sort-${rev}"
94+
{
95+
inherit src;
96+
nativeBuildInputs = [ pkgs.cargo-sort ];
97+
}
98+
''
99+
cargo-sort --check --workspace "$src"
100+
mkdir -p $out
101+
'';
102+
92103
no-todo-comments = pkgs.runCommand "no-todo-comments-${rev}" { inherit src; } ''
93104
if grep -rn --exclude-dir=contrib 'TO[D]O\|FIX[M]E' $src/ 2>/dev/null; then
94105
echo "FAIL: unresolved work-item markers found"
@@ -110,6 +121,7 @@
110121
lint = pkgs.symlinkJoin {
111122
name = "lint-checks-${rev}";
112123
paths = [
124+
checks.cargo-sort
113125
checks.clippy
114126
checks.doc
115127
checks.no-todo-comments

0 commit comments

Comments
 (0)