nixpkgs/pkgs/by-name/go/go-critic/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
1 KiB
Nix
Raw Normal View History

2024-01-03 09:59:22 +01:00
{ lib
, buildGoModule
, fetchFromGitHub
, testers
, nix-update-script
, go-critic
}:
buildGoModule rec {
pname = "go-critic";
2024-05-21 19:13:35 +02:00
version = "0.11.4";
2024-01-03 09:59:22 +01:00
src = fetchFromGitHub {
owner = "go-critic";
repo = "go-critic";
rev = "v${version}";
2024-05-21 19:13:35 +02:00
hash = "sha256-v/7fc3MRQoMQCKqZQVuZEm5R9ha5wusN+hEzp7aBpNk=";
2024-01-03 09:59:22 +01:00
};
2024-05-21 19:13:35 +02:00
vendorHash = "sha256-Qw4t2v/5IZnpZX8sR26DL0SYrjvfuJSzDUpZ4G0u6hU=";
2024-01-03 09:59:22 +01:00
subPackages = [
"cmd/gocritic"
];
allowGoReference = true;
ldflags = [
"-X main.Version=${version}"
];
passthru = {
tests.version = testers.testVersion {
package = go-critic;
command = "gocritic version";
};
updateScript = nix-update-script { };
};
meta = {
description = "Most opinionated Go source code linter for code audit";
homepage = "https://go-critic.com/";
changelog = "https://github.com/go-critic/go-critic/releases/tag/${src.rev}";
license = lib.licenses.mit;
mainProgram = "gocritic";
maintainers = with lib.maintainers; [ katexochen ];
};
}