Skip to content

Commit

Permalink
Perform header check in both makefiles (#153)
Browse files Browse the repository at this point in the history
- No change in CI, but this makes it easier to catch missing headers in the generator files before opening PRs.
  • Loading branch information
matthchr authored Jun 22, 2020
1 parent 317e01f commit e255d6a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,6 @@ fmt: ## Run go fmt against code
vet: ## Run go vet against code
$(GO) vet ./...

.PHONY: header-check
header-check: ## Runs header checks on all files to verify boilerplate
./scripts/verify_boilerplate.sh

.PHONY: tidy
tidy: ## Runs go mod to ensure tidy.
$(GO) mod tidy
Expand Down
2 changes: 1 addition & 1 deletion hack/generator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ V = 0
Q = $(if $(filter 1,$V),,@)

.PHONY: all
all: build test
all: header-check build test

.PHONY: manifests
manifests: $(CONTROLLER_GEN)
Expand Down
4 changes: 4 additions & 0 deletions tools.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Directories.
ROOT_DIR :=$(shell git rev-parse --show-toplevel)
TOOLS_DIR = $(abspath $(ROOT_DIR)/hack/tools)
SCRIPTS_DIR = $(abspath $(ROOT_DIR)/scripts)
TOOLS_BIN_DIR = $(TOOLS_DIR)/bin

GO_INSTALL = $(abspath $(ROOT_DIR)/scripts/go_install.sh)
Expand Down Expand Up @@ -39,6 +40,9 @@ $(GOLANGCI_LINT): ## Build golangci-lint from tools folder.
echo $(ROOT_DIR)
GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) github.com/golangci/golangci-lint/cmd/golangci-lint@v1.26.0

.PHONY: header-check
header-check: ## Runs header checks on all files to verify boilerplate
$(SCRIPTS_DIR)/verify_boilerplate.sh

# TODO: are these used?
$(GOLINT): ## Build golint
Expand Down

0 comments on commit e255d6a

Please sign in to comment.