Skip to content

Commit

Permalink
Add lint-e2e and lint-api targets
Browse files Browse the repository at this point in the history
When working on e2e or api we need a way to run lint quickly without
running complex golangci-lint command manually.

Signed-off-by: Nir Soffer <[email protected]>
  • Loading branch information
nirs authored and raghavendra-talur committed Oct 23, 2024
1 parent dace2c1 commit b54eaec
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,21 @@ generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."


.PHONY: lint
lint: golangci-bin ## Run configured golangci-lint and pre-commit.sh linters against the code.
# golangci-lint has a limitation that it doesn't lint subdirectories if
# they are a different module.
# see https://github.com/golangci/golangci-lint/issues/828

.PHONY: lint
lint: golangci-bin lint-e2e lint-api ## Run configured golangci-lint and pre-commit.sh linters against the code.
testbin/golangci-lint run ./... --config=./.golangci.yaml
cd api && ../testbin/golangci-lint run ./... --config=../.golangci.yaml
cd e2e && ../testbin/golangci-lint run ./... --config=../.golangci.yaml
hack/pre-commit.sh

lint-e2e: golangci-bin ## Run configured golangci-lint for e2e module
cd e2e && ../testbin/golangci-lint run ./... --config=../.golangci.yaml

lint-api: golangci-bin ## Run configured golangci-lint for api module
cd api && ../testbin/golangci-lint run ./... --config=../.golangci.yaml

.PHONY: create-rdr-env
create-rdr-env: drenv-prereqs ## Create a new rdr environment.
./hack/dev-env.sh create
Expand Down

0 comments on commit b54eaec

Please sign in to comment.