2022-03-30 09:31:56 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, installShellFiles
|
|
|
|
, rustfmt
|
2024-09-19 14:19:46 +00:00
|
|
|
, stdenv
|
2022-03-30 09:31:56 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "shisho";
|
|
|
|
version = "0.5.2";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "flatt-security";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-G7sHaDq+F5lXNaF1sSLUecdjZbCejJE79P4AQifKdFY=";
|
2022-03-30 09:31:56 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
2024-07-31 10:19:44 +00:00
|
|
|
cargoHash = "sha256-xd4andytmDMOIT+3DkmUC9fkxxGJ6yRY2WSdnGB6ZwY=";
|
2022-03-30 09:31:56 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
# required to build serde-sarif dependency
|
|
|
|
rustfmt
|
|
|
|
];
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
2022-03-30 09:31:56 +00:00
|
|
|
installShellCompletion --cmd shisho \
|
|
|
|
--bash <($out/bin/shisho completion bash) \
|
|
|
|
--fish <($out/bin/shisho completion fish) \
|
|
|
|
--zsh <($out/bin/shisho completion zsh)
|
|
|
|
'';
|
|
|
|
|
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
runHook preInstallCheck
|
|
|
|
|
|
|
|
$out/bin/shisho --help
|
|
|
|
$out/bin/shisho --version | grep "${version}"
|
|
|
|
|
|
|
|
runHook postInstallCheck
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://docs.shisho.dev/shisho/";
|
|
|
|
changelog = "https://docs.shisho.dev/changelog/";
|
|
|
|
description = "Lightweight static analyzer for several programming languages";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "shisho";
|
2022-03-30 09:31:56 +00:00
|
|
|
longDescription = ''
|
|
|
|
Shisho is a lightweight static code analyzer designed for developers and
|
|
|
|
is the core engine for Shisho products. It is, so to speak, like a
|
|
|
|
pluggable and configurable linter; it gives developers a way to codify
|
|
|
|
your domain knowledge over your code as rules. With powerful automation
|
|
|
|
and integration capabilities, the rules will help you find and fix issues
|
|
|
|
semiautomatically.
|
|
|
|
'';
|
|
|
|
license = licenses.agpl3Only;
|
|
|
|
maintainers = with maintainers; [ jk ];
|
|
|
|
};
|
|
|
|
}
|