Skip to content

Commit

Permalink
Add protobuf linter (#314)
Browse files Browse the repository at this point in the history
Add `make lint` that will run protobuf linter on our codebase.

After finishing #262 all linter
errors should be gone and we can add `make lint` to our CI.

resolve #302
  • Loading branch information
husio authored and alpe committed Feb 15, 2019
1 parent ef76b35 commit a3238d5
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ deps: tools
tools:
@go get github.com/golang/dep/cmd/dep

lint: prototool-bin
prototool lint

prototool-bin:
ifndef $(shell command -v prototool help > /dev/null)
@@curl -sSL https://github.com/uber/prototool/releases/download/v1.3.0/prototool-$(shell uname -s)-$(shell uname -m) -o $(HOME)/.bin/prototool
@@chmod +x $(HOME)/.bin/prototool
endif


protoc:
protoc --gogofaster_out=. app/*.proto
protoc --gogofaster_out=. crypto/*.proto
Expand Down
28 changes: 28 additions & 0 deletions prototool.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
excludes:
- ./vendor

protoc:
# The Protobuf version to use from https://github.com/protocolbuffers/protobuf/releases.
# By default use 3.6.1.
# You probably want to set this to make your builds completely reproducible.
version: 3.6.1

# Additional paths to include with -I to protoc.
# By default, the directory of the config file is included,
# or the current directory if there is no config file.
includes:
- ./vendor
- ../../..


# If not set, compile will fail if there are unused imports.
# Setting this will ignore unused imports.
allow_unused_imports: false

lint:
rules:
remove:
- FILE_OPTIONS_REQUIRE_JAVA_MULTIPLE_FILES
- FILE_OPTIONS_REQUIRE_JAVA_OUTER_CLASSNAME
- FILE_OPTIONS_REQUIRE_JAVA_PACKAGE
- FILE_OPTIONS_REQUIRE_GO_PACKAGE

0 comments on commit a3238d5

Please sign in to comment.