From d20e68af6d5e11d6b811284800f310eb1b4c115d Mon Sep 17 00:00:00 2001 From: Will Bush Date: Mon, 25 Mar 2024 21:56:12 -0500 Subject: [PATCH 1/2] Fix main.rs tests clippy lints --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index dcc9cb9..9a017f3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -208,7 +208,7 @@ mod tests { let temp_nixpkgs = tempdir()?; let path = temp_nixpkgs.path(); - if is_case_insensitive_fs(&path)? { + if is_case_insensitive_fs(path)? { eprintln!("We're on a case-insensitive filesystem, skipping case-sensitivity test"); return Ok(()); } @@ -223,7 +223,7 @@ mod tests { test_nixpkgs( "case_sensitive", - &path, + path, "pkgs/by-name/fo: Duplicate case-sensitive package directories \"foO\" and \"foo\".\nThis PR introduces the problems listed above. Please fix them before merging, otherwise the base branch would break.\n", )?; From 6f3f2935ba62eb11f7337f92fa1b4957023f023b Mon Sep 17 00:00:00 2001 From: Will Bush Date: Mon, 25 Mar 2024 22:02:16 -0500 Subject: [PATCH 2/2] Lint tests with clippy --- package.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.nix b/package.nix index d6334c5..5a3c392 100644 --- a/package.nix +++ b/package.nix @@ -39,7 +39,8 @@ rustPlatform.buildRustPackage { preCheck = initNix; postCheck = '' cargo fmt --check - cargo clippy -- -D warnings + # --tests or --all-targets include tests for linting + cargo clippy --all-targets -- -D warnings ''; postInstall = '' wrapProgram $out/bin/nixpkgs-check-by-name \