Skip to content
This repository has been archived by the owner on Mar 4, 2022. It is now read-only.

Expose prototool as a Bazel rule #556

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open

Expose prototool as a Bazel rule #556

wants to merge 3 commits into from

Conversation

jathu
Copy link
Contributor

@jathu jathu commented May 30, 2020

In this PR we create a rule that allows prototool to be invoked by a Bazel run command. Much of the inspiration came from buildifier.

Although we can currently invoke prototool using the provided binary, it requires all arguments to be absolute:

> bazel run @com_uber_prototool//cmd/prototool -- lint $PWD/protobuf/grpc/health/v1/health.proto
../../../../../../../../../../../../../../../../../Users/appleseed/protobuf/grpc/health/v1/health.proto:26:1:Expected "healthv1" for option "go_package" but was "google.golang.org/grpc/health/grpc_health_v1".

As you can see, the output isn't that elegant either. Compare that to the new rule:

> bazel run //:prototool -- lint protobuf/grpc/health/v1/health.proto
protobuf/grpc/health/v1/health.proto:26:1:Expected "healthv1" for option "go_package" but was "google.golang.org/grpc/health/grpc_health_v1".

@jathu jathu changed the title Expose prototool as Bazel rule Expose prototool as a Bazel rule May 30, 2020
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Jathu Satkunarajah seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants