crane/lib/cargoClippy.nix

24 lines
552 B
Nix
Raw Normal View History

{ cargoBuild
2022-01-04 23:07:04 +03:00
, clippy
}:
{ cargoArtifacts
, cargoClippyExtraArgs ? ""
, cargoExtraArgs ? ""
, ...
}@origArgs:
let
args = builtins.removeAttrs origArgs [ "cargoClippyExtraArgs" ];
in
cargoBuild (args // {
2022-01-04 23:07:04 +03:00
inherit cargoArtifacts;
pnameSuffix = "-clippy";
2022-01-04 23:07:04 +03:00
cargoBuildCommand = "cargo clippy --workspace --release --all-targets";
cargoExtraArgs = "${cargoExtraArgs} ${cargoClippyExtraArgs}";
2022-01-04 23:07:04 +03:00
nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ clippy ];
doCheck = false; # We don't need to run tests to benefit from `cargo clippy`
2022-01-04 23:07:04 +03:00
})