nixpkgs/pkgs/development/tools/golangci-lint/default.nix

35 lines
1,001 B
Nix

{ buildGoModule, fetchFromGitHub, lib, installShellFiles }:
buildGoModule rec {
pname = "golangci-lint";
version = "1.28.3";
src = fetchFromGitHub {
owner = "golangci";
repo = "golangci-lint";
rev = "v${version}";
sha256 = "0bjjdr8nxbn2h23x62sywbiv5y4rpk3xg7lk6lkbvmn7625brfvx";
};
vendorSha256 = "15wl6xblwyqs7pbbi2yy3y0ysj0k34qf05jfh69k9i9xf9k8hp6a";
subPackages = [ "cmd/golangci-lint" ];
nativeBuildInputs = [ installShellFiles ];
buildFlagsArray = [ "-ldflags=-s -w -X main.version=${version} -X main.commit=${src.rev} -X main.date=19700101-00:00:00" ];
postInstall = ''
for shell in bash zsh; do
HOME=$TMPDIR $out/bin/golangci-lint completion $shell > golangci-lint.$shell
installShellCompletion golangci-lint.$shell
done
'';
meta = with lib; {
description = "Fast linters Runner for Go";
homepage = "https://golangci-lint.run/";
license = licenses.gpl3;
maintainers = with maintainers; [ anpryl manveru ];
};
}