crane/lib/cargoClippy.nix
Ivan Petkov 3024283855
cargoClippy: change behavior to install cargo artifacts by default
* This allows potentially chaining `cargoClippy` invocations with other
  derivations
2022-02-13 09:34:26 -08:00

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`
})