From 5e7cc9a640ffd6b0573dea13fc22209f3039a610 Mon Sep 17 00:00:00 2001 From: seth Date: Thu, 9 Nov 2023 20:31:15 -0500 Subject: [PATCH] sarif-fmt: init at 0.4.2 --- pkgs/by-name/sa/sarif-fmt/package.nix | 58 +++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 pkgs/by-name/sa/sarif-fmt/package.nix diff --git a/pkgs/by-name/sa/sarif-fmt/package.nix b/pkgs/by-name/sa/sarif-fmt/package.nix new file mode 100644 index 000000000000..ad273bca0d64 --- /dev/null +++ b/pkgs/by-name/sa/sarif-fmt/package.nix @@ -0,0 +1,58 @@ +{ + lib, + stdenv, + fetchFromGitHub, + rustPlatform, + clippy, + sarif-fmt, + testers, +}: +rustPlatform.buildRustPackage rec { + pname = "sarif-fmt"; + version = "0.4.2"; + + src = fetchFromGitHub { + owner = "psastras"; + repo = "sarif-rs"; + rev = "sarif-fmt-v${version}"; + hash = "sha256-EzWzDeIeSJ11CVcVyAhMjYQJcKHnieRrFkULc5eXAno="; + }; + + cargoHash = "sha256-dHOxVLXtnqSHMX5r1wFxqogDf9QdnOZOjTyYFahru34="; + cargoBuildFlags = [ + "--package" + "sarif-fmt" + ]; + cargoTestFlags = cargoBuildFlags; + + # `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.isDarwin; + + nativeCheckInputs = [ + # `test_clippy` + clippy + ]; + + checkFlags = [ + # this test uses nix so...no go + "--skip=test_clang_tidy" + # ditto + "--skip=test_hadolint" + # ditto + "--skip=test_shellcheck" + ]; + + passthru = { + tests.version = testers.testVersion { package = sarif-fmt; }; + }; + + 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"; + }; +}