nixpkgs/pkgs/development/tools/protolint/default.nix

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

41 lines
1.4 KiB
Nix
Raw Normal View History

2022-04-26 14:14:59 +00:00
{ lib, buildGoModule, fetchFromGitHub }:
buildGoModule rec {
pname = "protolint";
2024-05-03 13:54:13 +00:00
version = "0.49.7";
2022-04-26 14:14:59 +00:00
src = fetchFromGitHub {
owner = "yoheimuta";
repo = pname;
2024-01-04 20:24:15 +00:00
rev = "v${version}";
2024-05-03 13:54:13 +00:00
hash = "sha256-XXF37r9p6cAU7q3bOzkwPpy2kKXKhp944d22jtJox7k=";
2022-04-26 14:14:59 +00:00
};
2024-05-03 13:54:13 +00:00
vendorHash = "sha256-JmS80vAFP9tIyGjvASAEEY+0tk3SpNqXdZajvi9mH5E=";
2022-04-26 14:14:59 +00:00
# Something about the way we run tests causes issues. It doesn't happen
# when using "go test" directly:
# === RUN TestEnumFieldNamesPrefixRule_Apply_fix/no_fix_for_a_correct_proto
# util_test.go:35: open : no such file or directory
# === RUN TestEnumFieldNamesPrefixRule_Apply_fix/fix_for_an_incorrect_proto
# util_test.go:35: open : no such file or directory
excludedPackages = [ "internal" ];
ldflags = let
rev = builtins.substring 0 7 src.rev;
in [
"-X github.com/yoheimuta/protolint/internal/cmd.version=${version}"
"-X github.com/yoheimuta/protolint/internal/cmd.revision=${rev}"
"-X github.com/yoheimuta/protolint/internal/cmd/protocgenprotolint.version=${version}"
"-X github.com/yoheimuta/protolint/internal/cmd/protocgenprotolint.revision=${rev}"
];
meta = with lib; {
description = "A pluggable linter and fixer to enforce Protocol Buffer style and conventions";
homepage = "https://github.com/yoheimuta/protolint";
license = licenses.mit;
platforms = platforms.all;
maintainers = [ maintainers.zane ];
2023-11-10 11:59:41 +00:00
mainProgram = "protolint";
2022-04-26 14:14:59 +00:00
};
}