2022-08-12 12:06:08 +00:00
|
|
|
{ buildGoModule, fetchFromGitHub, lib, installShellFiles }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "golangci-lint";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "1.53.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "golangci";
|
|
|
|
repo = "golangci-lint";
|
|
|
|
rev = "v${version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-5qTWYmr82BFuyA+lS1HwCHqdrtWScI6tuu0noRbali8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
vendorHash = "sha256-MEfvBlecFIXqAet3V9qHRmeUzzcsSnkfM3HMTMlxss0=";
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
subPackages = [ "cmd/golangci-lint" ];
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2021-08-22 07:53:02 +00:00
|
|
|
ldflags = [
|
2022-08-12 12:06:08 +00:00
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X main.version=${version}"
|
|
|
|
"-X main.commit=v${version}"
|
|
|
|
"-X main.date=19700101-00:00:00"
|
2021-08-22 07:53:02 +00:00
|
|
|
];
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2022-01-07 04:07:37 +00:00
|
|
|
for shell in bash zsh fish; do
|
2020-07-18 16:06:22 +00:00
|
|
|
HOME=$TMPDIR $out/bin/golangci-lint completion $shell > golangci-lint.$shell
|
|
|
|
installShellCompletion golangci-lint.$shell
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
2020-07-18 16:06:22 +00:00
|
|
|
description = "Fast linters Runner for Go";
|
|
|
|
homepage = "https://golangci-lint.run/";
|
2021-02-22 21:28:39 +00:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = with maintainers; [ anpryl manveru mic92 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|