-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(lint): use config to set golangci linter rules
Signed-off-by: Artur Troian <[email protected]>
- Loading branch information
Showing
4 changed files
with
31 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,7 @@ | ||
SUBLINTERS = unused \ | ||
misspell \ | ||
goerr113 \ | ||
gofmt \ | ||
gocritic \ | ||
goconst \ | ||
ineffassign \ | ||
unparam \ | ||
staticcheck \ | ||
revive \ | ||
gosec \ | ||
exportloopref \ | ||
prealloc | ||
# TODO: ^ gochecknoglobals | ||
.PHONY: lint | ||
lint: $(GOLANGCI_LINT) | ||
$(GOLANGCI_LINT_RUN) ./... --issues-exit-code=0 --deadline=20m | ||
|
||
# Execute the same lint methods as configured in .github/workflows/tests.yaml | ||
# Clear feedback from each method as it fails. | ||
.PHONY: test-sublinters | ||
test-sublinters: $(patsubst %, test-sublinter-%,$(SUBLINTERS)) | ||
|
||
.PHONY: test-lint-all | ||
test-lint-all: $(GOLANGCI_LINT) | ||
$(GOLANGCI_LINT_RUN) ./... --issues-exit-code=0 --deadline=10m | ||
|
||
.PHONY: test-sublinter-misspell | ||
test-sublinter-misspell: $(GOLANGCI_LINT) | ||
$(LINT) misspell --no-config | ||
|
||
.PHONY: test-sublinter-ineffassign | ||
test-sublinter-ineffassign: $(GOLANGCI_LINT) | ||
$(LINT) ineffassign --no-config | ||
|
||
.PHONY: test-sublinter-% | ||
test-sublinter-%: $(GOLANGCI_LINT) | ||
.PHONY: lint-% | ||
lint-%: $(GOLANGCI_LINT) | ||
$(LINT) $* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters