Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add extraArgs for clippy #499

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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