2022-01-05 01:18:29 +03:00
|
|
|
{ cargoBuild
|
2022-01-04 23:07:04 +03:00
|
|
|
, clippy
|
|
|
|
}:
|
|
|
|
|
|
|
|
{ cargoArtifacts
|
|
|
|
, cargoClippyExtraArgs ? ""
|
|
|
|
, cargoExtraArgs ? ""
|
|
|
|
, ...
|
|
|
|
}@origArgs:
|
|
|
|
let
|
|
|
|
args = builtins.removeAttrs origArgs [ "cargoClippyExtraArgs" ];
|
|
|
|
in
|
2022-01-05 01:18:29 +03:00
|
|
|
cargoBuild (args // {
|
2022-01-04 23:07:04 +03:00
|
|
|
inherit cargoArtifacts;
|
2022-01-05 04:45:31 +03:00
|
|
|
pnameSuffix = "-clippy";
|
2022-01-04 23:07:04 +03:00
|
|
|
|
2022-01-05 01:18:29 +03:00
|
|
|
cargoBuildCommand = "cargo clippy --workspace --release --all-targets";
|
|
|
|
cargoExtraArgs = "${cargoExtraArgs} ${cargoClippyExtraArgs}";
|
2022-01-04 23:07:04 +03:00
|
|
|
|
|
|
|
nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ clippy ];
|
|
|
|
|
2022-05-09 05:44:42 +03:00
|
|
|
doCheck = false; # We don't need to run tests to benefit from `cargo clippy`
|
2022-01-04 23:07:04 +03:00
|
|
|
})
|