aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2019-08-28 23:22:36 -0500
committerEric Biggers <ebiggers@google.com>2019-08-28 23:22:36 -0500
commit305e5cd4e92a98c5d1e9a06fa9f424cd4ce40e49 (patch)
tree03ef4e6440da491f68a03eb981b5307ec17681b5
parentb41569d397d3e66099cde07d8eef36b2f42dd0ec (diff)
Makefile: exclude generated files from 'make format'
Due to a goimports update, 'make format' is now changing metadata.pb.go. But this fix can't be committed because this file is generated by 'make gen'. Fix this by not formatting generated files.
-rw-r--r--Makefile3
1 files changed, 2 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 310be26..d6c5782 100644
--- a/Makefile
+++ b/Makefile
@@ -75,6 +75,7 @@ override GO_FLAGS += --ldflags '$(GO_LINK_FLAGS)'
###### Find All Files and Directories ######
FILES := $(shell find . \( -path ./vendor -o -path "./.*" \) -prune -o -type f -printf "%P\n")
GO_FILES := $(filter %.go,$(FILES))
+GO_NONGEN_FILES := $(filter-out %.pb.go,$(GO_FILES))
GO_DIRS := $(sort $(dir $(GO_FILES)))
C_FILES := $(filter %.c %.h,$(FILES))
PROTO_FILES := $(filter %.proto,$(FILES))
@@ -95,7 +96,7 @@ gen: $(BIN)/protoc $(BIN)/protoc-gen-go $(PROTO_FILES)
protoc --go_out=. $(PROTO_FILES)
format: $(BIN)/goimports
- goimports -w $(GO_DIRS)
+ goimports -w $(GO_NONGEN_FILES)
clang-format -i -style=Google $(C_FILES)
lint: $(BIN)/golint $(BIN)/staticcheck $(BIN)/misspell