39 lines
1 KiB
Nix
39 lines
1 KiB
Nix
{ buildGoModule, fetchFromGitHub, lib, installShellFiles }:
|
|
|
|
buildGoModule rec {
|
|
pname = "golangci-lint";
|
|
version = "1.39.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "golangci";
|
|
repo = "golangci-lint";
|
|
rev = "v${version}";
|
|
sha256 = "0c9yka27k4v1waijk7mn7k31l5a373sclykypflchy7xnlrsa18v";
|
|
};
|
|
|
|
vendorSha256 = "1685iv1lsal462c8xqvs76x9dwvbwazrak902j0p12s0fyb66lpl";
|
|
|
|
doCheck = false;
|
|
|
|
subPackages = [ "cmd/golangci-lint" ];
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
preBuild = ''
|
|
buildFlagsArray+=("-ldflags=-s -w -X main.version=${version} -X main.commit=v${version} -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.gpl3Plus;
|
|
maintainers = with maintainers; [ anpryl manveru mic92 ];
|
|
};
|
|
}
|