mirror of
https://github.com/ipetkov/crane.git
synced 2024-11-27 02:52:02 +03:00
8de515289f
* This allows callers to opt-out of using `--all-targets` without having to override the entire cargo command itself
24 lines
540 B
Nix
24 lines
540 B
Nix
{ cargoBuild
|
|
, clippy
|
|
}:
|
|
|
|
{ cargoArtifacts
|
|
, cargoClippyExtraArgs ? "--all-targets"
|
|
, cargoExtraArgs ? ""
|
|
, ...
|
|
}@origArgs:
|
|
let
|
|
args = builtins.removeAttrs origArgs [ "cargoClippyExtraArgs" ];
|
|
in
|
|
cargoBuild (args // {
|
|
inherit cargoArtifacts;
|
|
pnameSuffix = "-clippy";
|
|
|
|
cargoBuildCommand = "cargoWithProfile clippy";
|
|
cargoExtraArgs = "${cargoExtraArgs} ${cargoClippyExtraArgs}";
|
|
|
|
nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ clippy ];
|
|
|
|
doCheck = false; # We don't need to run tests to benefit from `cargo clippy`
|
|
})
|