1{ lib
2, fetchFromGitHub
3, rustPlatform
4, installShellFiles
5, rustfmt
6}:
7
8rustPlatform.buildRustPackage rec {
9 pname = "shisho";
10 version = "0.5.2";
11
12 src = fetchFromGitHub {
13 owner = "flatt-security";
14 repo = pname;
15 rev = "v${version}";
16 sha256 = "sha256-G7sHaDq+F5lXNaF1sSLUecdjZbCejJE79P4AQifKdFY=";
17 fetchSubmodules = true;
18 };
19 cargoSha256 = "sha256-xd4andytmDMOIT+3DkmUC9fkxxGJ6yRY2WSdnGB6ZwY=";
20
21 nativeBuildInputs = [
22 installShellFiles
23 # required to build serde-sarif dependency
24 rustfmt
25 ];
26
27 postInstall = ''
28 installShellCompletion --cmd shisho \
29 --bash <($out/bin/shisho completion bash) \
30 --fish <($out/bin/shisho completion fish) \
31 --zsh <($out/bin/shisho completion zsh)
32 '';
33
34 doInstallCheck = true;
35 installCheckPhase = ''
36 runHook preInstallCheck
37
38 $out/bin/shisho --help
39 $out/bin/shisho --version | grep "${version}"
40
41 runHook postInstallCheck
42 '';
43
44 meta = with lib; {
45 homepage = "https://docs.shisho.dev/shisho/";
46 changelog = "https://docs.shisho.dev/changelog/";
47 description = "Lightweight static analyzer for several programming languages";
48 longDescription = ''
49 Shisho is a lightweight static code analyzer designed for developers and
50 is the core engine for Shisho products. It is, so to speak, like a
51 pluggable and configurable linter; it gives developers a way to codify
52 your domain knowledge over your code as rules. With powerful automation
53 and integration capabilities, the rules will help you find and fix issues
54 semiautomatically.
55 '';
56 license = licenses.agpl3Only;
57 maintainers = with maintainers; [ jk ];
58 };
59}