mirror of
https://github.com/ipetkov/crane.git
synced 2024-11-23 08:22:41 +03:00
b47fafa717
This allows caching all artifacts (including from dev-dependencies) such that tools like clippy don't have to generate them every time they run.
24 lines
552 B
Nix
24 lines
552 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 clippy`
|
|
})
|