Skip to content

Commit

Permalink
Merge pull request NixOS#168566 from vs49688/protolint
Browse files Browse the repository at this point in the history
protolint: init at 0.37.1
  • Loading branch information
ryantm authored Apr 27, 2022
2 parents d2f1613 + 3babd37 commit 53bccda
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
39 changes: 39 additions & 0 deletions pkgs/development/tools/protolint/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{ lib, buildGoModule, fetchFromGitHub }:
buildGoModule rec {
pname = "protolint";
version = "0.37.1";

src = fetchFromGitHub {
owner = "yoheimuta";
repo = pname;
rev = "6aa30515838cc0adf7c76a9461f52bdc713f2e9f";
sha256 = "sha256-oKGA5FZpT3E5G7oREGAojdu4Xn8JPd7IYwfueK9QA34=";
};

vendorSha256 = "sha256-iLQwx3B5n21ZXefWiGBBL9roa9LIFByzB8KXLywhvKs=";

# 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 ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,8 @@ with pkgs;

protoc-gen-validate = callPackage ../development/tools/protoc-gen-validate { };

protolint = callPackage ../development/tools/protolint { };

ptags = callPackage ../development/tools/misc/ptags { };

ptouch-print = callPackage ../misc/ptouch-print { };
Expand Down

0 comments on commit 53bccda

Please sign in to comment.