Skip to content

Commit

Permalink
Merge pull request #499 from mkenigs/clippy-extraArgs
Browse files Browse the repository at this point in the history
Add extraArgs for clippy
  • Loading branch information
domenkozar authored Oct 2, 2024
2 parents 2f5ae3f + 9d2422b commit 5f58871
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion modules/hooks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,11 @@ in
description = "Run clippy with --all-features";
default = false;
};
extraArgs = mkOption {
type = types.str;
description = "Additional arguments to pass to clippy";
default = "";
};
};

config.extraPackages = [
Expand Down Expand Up @@ -2073,7 +2078,7 @@ in
description = "Lint Rust code.";
package = wrapper;
packageOverrides = { cargo = tools.cargo; clippy = tools.clippy; };
entry = "${hooks.clippy.package}/bin/cargo-clippy clippy ${cargoManifestPathArg} ${lib.optionalString hooks.clippy.settings.offline "--offline"} ${lib.optionalString hooks.clippy.settings.allFeatures "--all-features"} -- ${lib.optionalString hooks.clippy.settings.denyWarnings "-D warnings"}";
entry = "${hooks.clippy.package}/bin/cargo-clippy clippy ${cargoManifestPathArg} ${lib.optionalString hooks.clippy.settings.offline "--offline"} ${lib.optionalString hooks.clippy.settings.allFeatures "--all-features"} ${hooks.clippy.settings.extraArgs} -- ${lib.optionalString hooks.clippy.settings.denyWarnings "-D warnings"}";
files = "\\.rs$";
pass_filenames = false;
};
Expand Down

0 comments on commit 5f58871

Please sign in to comment.