mirror of
https://github.com/ipetkov/crane.git
synced 2024-11-30 05:57:28 +03:00
3024283855
* This allows potentially chaining `cargoClippy` invocations with other derivations
24 lines
551 B
Nix
24 lines
551 B
Nix
{ cargoBuild
|
|
, clippy
|
|
}:
|
|
|
|
{ cargoArtifacts
|
|
, cargoClippyExtraArgs ? ""
|
|
, cargoExtraArgs ? ""
|
|
, ...
|
|
}@origArgs:
|
|
let
|
|
args = builtins.removeAttrs origArgs [ "cargoClippyExtraArgs" ];
|
|
in
|
|
cargoBuild (args // {
|
|
inherit cargoArtifacts;
|
|
pnameSuffix = "-clippy";
|
|
|
|
cargoBuildCommand = "cargo clippy --workspace --release --all-targets";
|
|
cargoExtraArgs = "${cargoExtraArgs} ${cargoClippyExtraArgs}";
|
|
|
|
nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ clippy ];
|
|
|
|
doCheck = false; # We don't need to run tests to benefit from `cargo check`
|
|
})
|