Browse Source

add a common-lint-fix make target to make golangci-lint fix found issues if it's supported by the linter

clean up common-lint target

Signed-off-by: machine424 <ayoubmrini424@gmail.com>
pull/13707/head
machine424 9 months ago
parent
commit
6998bfab59
No known key found for this signature in database
GPG Key ID: A4B001A4FDEE017D
  1. 10
      Makefile.common

10
Makefile.common

@ -169,12 +169,16 @@ common-vet:
common-lint: $(GOLANGCI_LINT)
ifdef GOLANGCI_LINT
@echo ">> running golangci-lint"
# 'go list' needs to be executed before staticcheck to prepopulate the modules cache.
# Otherwise staticcheck might fail randomly for some reason not yet explained.
$(GO) list -e -compiled -test=true -export=false -deps=true -find=false -tags= -- ./... > /dev/null
$(GOLANGCI_LINT) run $(GOLANGCI_LINT_OPTS) $(pkgs)
endif
.PHONY: common-lint-fix
common-lint-fix: $(GOLANGCI_LINT)
ifdef GOLANGCI_LINT
@echo ">> running golangci-lint fix"
$(GOLANGCI_LINT) run --fix $(GOLANGCI_LINT_OPTS) $(pkgs)
endif
.PHONY: common-yamllint
common-yamllint:
@echo ">> running yamllint on all YAML files in the repository"

Loading…
Cancel
Save