2023-11-10 01:31:15 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
2024-07-15 18:35:32 +00:00
|
|
|
fetchCrate,
|
2023-11-10 01:31:15 +00:00
|
|
|
rustPlatform,
|
2024-07-15 18:36:11 +00:00
|
|
|
nix-update-script,
|
2024-07-15 18:37:28 +00:00
|
|
|
versionCheckHook,
|
2023-11-10 01:31:15 +00:00
|
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "sarif-fmt";
|
2024-09-06 07:04:30 +00:00
|
|
|
version = "0.6.6";
|
2023-11-10 01:31:15 +00:00
|
|
|
|
2024-07-15 18:35:32 +00:00
|
|
|
src = fetchCrate {
|
|
|
|
inherit pname version;
|
2024-09-06 07:04:30 +00:00
|
|
|
hash = "sha256-0LyTXyycdIq0FuBTxE9D7FRFfn4iZnDKOt+Rk4P1HwU=";
|
2023-11-10 01:31:15 +00:00
|
|
|
};
|
|
|
|
|
2024-09-06 07:04:30 +00:00
|
|
|
cargoHash = "sha256-UpVZtZ3d0N/uL9+yc1gIO3SQsoqvUBMEDjdl9SDSKd8=";
|
2023-11-10 01:31:15 +00:00
|
|
|
|
|
|
|
# `test_clippy` (the only test we enable) is broken on Darwin
|
|
|
|
# because `--enable-profiler` is not enabled in rustc on Darwin
|
|
|
|
# error[E0463]: can't find crate for profiler_builtins
|
|
|
|
doCheck = !stdenv.hostPlatform.isDarwin;
|
|
|
|
|
|
|
|
checkFlags = [
|
2024-07-15 18:35:32 +00:00
|
|
|
# these tests use nix so...no go
|
2023-11-10 01:31:15 +00:00
|
|
|
"--skip=test_clang_tidy"
|
|
|
|
"--skip=test_hadolint"
|
|
|
|
"--skip=test_shellcheck"
|
2024-07-15 18:35:32 +00:00
|
|
|
|
|
|
|
# requires files not present in the crates.io tarball
|
|
|
|
"--skip=test_clipp"
|
2023-11-10 01:31:15 +00:00
|
|
|
];
|
|
|
|
|
2024-07-15 18:37:28 +00:00
|
|
|
nativeInstallCheckInputs = [ versionCheckHook ];
|
|
|
|
doInstallCheck = true;
|
|
|
|
|
2023-11-10 01:31:15 +00:00
|
|
|
passthru = {
|
2024-07-15 18:36:11 +00:00
|
|
|
updateScript = nix-update-script { };
|
2023-11-10 01:31:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A CLI tool to pretty print SARIF diagnostics";
|
|
|
|
homepage = "https://psastras.github.io/sarif-rs";
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ getchoo ];
|
|
|
|
mainProgram = "sarif-fmt";
|
|
|
|
};
|
|
|
|
}
|