Skip to content

Commit

Permalink
make: add lint-config-verify target for config validation
Browse files Browse the repository at this point in the history
This change adds a new Makefile target `lint-config-verify`,
which runs:"golangci-lint config verify --config=./.golangci.yaml"
locally detect issues in `.golangci.yaml`. This allows to detect
issues with the config file quickly without running the entire ci.
Additionally, `lint` now depends on `lint-config-verify` to ensure
the config is always valid before running lint checks.

Signed-off-by: Parikshith <[email protected]>
  • Loading branch information
parikshithb authored and nirs committed Feb 20, 2025
1 parent 644efd2 commit 15ccd33
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,13 @@ generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and
# 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.
lint: golangci-bin lint-config-verify lint-e2e lint-api ## Run configured golangci-lint and pre-commit.sh linters against the code.
testbin/golangci-lint run ./... --config=./.golangci.yaml
hack/pre-commit.sh

lint-config-verify: golangci-bin ## Verify golangci-lint configuration file
testbin/golangci-lint config verify --config=./.golangci.yaml

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

Expand Down

0 comments on commit 15ccd33

Please sign in to comment.