mirror of
https://github.com/ipetkov/crane.git
synced 2024-11-22 23:17:15 +03:00
7fc1a8fec3
* This allows for fewer assumptions about the project structure * The old behavior can easily be brought back by setting `cargoExtraArgs = "--workspace";` in any derivation
24 lines
540 B
Nix
24 lines
540 B
Nix
{ cargoBuild
|
|
, clippy
|
|
}:
|
|
|
|
{ cargoArtifacts
|
|
, cargoClippyExtraArgs ? ""
|
|
, cargoExtraArgs ? ""
|
|
, ...
|
|
}@origArgs:
|
|
let
|
|
args = builtins.removeAttrs origArgs [ "cargoClippyExtraArgs" ];
|
|
in
|
|
cargoBuild (args // {
|
|
inherit cargoArtifacts;
|
|
pnameSuffix = "-clippy";
|
|
|
|
cargoBuildCommand = "cargo clippy --release --all-targets";
|
|
cargoExtraArgs = "${cargoExtraArgs} ${cargoClippyExtraArgs}";
|
|
|
|
nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ clippy ];
|
|
|
|
doCheck = false; # We don't need to run tests to benefit from `cargo clippy`
|
|
})
|