Skip to content

Commit

Permalink
update make lint to run goimports and download it to the correct place
Browse files Browse the repository at this point in the history
  • Loading branch information
williamlfish authored and tekton-robot committed Nov 21, 2023
1 parent 4fcd2b8 commit 193b54a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ check: lint test
test: test-unit ## run all tests

.PHONY: lint
lint: lint-go lint-yaml ## run all linters
lint: lint-go goimports lint-yaml ## run all linters

GOLANGCILINT = $(BIN)/golangci-lint
$(BIN)/golangci-lint: ; $(info $(M) getting golangci-lint $(GOLANGCI_VERSION))
Expand All @@ -104,12 +104,13 @@ lint-go: | $(GOLANGCILINT) ; $(info $(M) running golangci-lint…) @ ## Run gola
@rm -f $(GOLANGCILINT)

GOIMPORTS = $(BIN)/goimports
$(BIN)/goimports: PACKAGE=golang.org/x/tools/cmd/goimports
$(GOIMPORTS): ; $(info $(M) getting goimports )
GOBIN=$(BIN) $(GO) install -mod=mod golang.org/x/tools/cmd/goimports

.PHONY: goimports
goimports: | $(GOIMPORTS) ; $(info $(M) running goimports…) ## Run goimports
$Q $(GOIMPORTS) -l -e -w pkg cmd test

@rm -f $(GOIMPORTS)

.PHONY: lint-yaml
lint-yaml: ${YAML_FILES} ; $(info $(M) running yamllint…) ## runs yamllint on all yaml files
Expand Down

0 comments on commit 193b54a

Please sign in to comment.