Skip to content

Commit 8455184

Browse files
committed
feat: allow configuring clippy allowed lints
1 parent 61ab0e8 commit 8455184

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

modules/hooks.nix

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,12 @@ in
283283
description = "Additional arguments to pass to clippy";
284284
default = "";
285285
};
286+
allowedLints = mkOption {
287+
type = types.listOf types.str;
288+
description = "Lints to allow, passed to clippy as `-A <lint>`";
289+
default = [ ];
290+
example = [ "clippy::too_many_arguments" ];
291+
};
286292
};
287293

288294
config.extraPackages = [
@@ -2955,7 +2961,7 @@ in
29552961
description = "Lint Rust code.";
29562962
package = wrapper;
29572963
packageOverrides = { cargo = tools.cargo; clippy = tools.clippy; };
2958-
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"}";
2964+
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"} ${lib.concatMapStringsSep " " (lint: "-A ${lib.escapeShellArg lint}") hooks.clippy.settings.allowedLints}";
29592965
files = "\\.rs$";
29602966
pass_filenames = false;
29612967
};

0 commit comments

Comments
 (0)