mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-02 19:14:14 +00:00
571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
62 lines
1.7 KiB
Nix
62 lines
1.7 KiB
Nix
{ lib
|
|
, fetchFromGitHub
|
|
, rustPlatform
|
|
, installShellFiles
|
|
, rustfmt
|
|
, stdenv
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "shisho";
|
|
version = "0.5.2";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "flatt-security";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
hash = "sha256-G7sHaDq+F5lXNaF1sSLUecdjZbCejJE79P4AQifKdFY=";
|
|
fetchSubmodules = true;
|
|
};
|
|
cargoHash = "sha256-xd4andytmDMOIT+3DkmUC9fkxxGJ6yRY2WSdnGB6ZwY=";
|
|
|
|
nativeBuildInputs = [
|
|
installShellFiles
|
|
# required to build serde-sarif dependency
|
|
rustfmt
|
|
];
|
|
|
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
|
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";
|
|
mainProgram = "shisho";
|
|
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 ];
|
|
};
|
|
}
|