forked from influxdata/telegraf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new linter commands (influxdata#9020)
- Loading branch information
Showing
2 changed files
with
29 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,15 +69,17 @@ all: | |
.PHONY: help | ||
help: | ||
@echo 'Targets:' | ||
@echo ' all - download dependencies and compile telegraf binary' | ||
@echo ' deps - download dependencies' | ||
@echo ' telegraf - compile telegraf binary' | ||
@echo ' test - run short unit tests' | ||
@echo ' fmt - format source files' | ||
@echo ' tidy - tidy go modules' | ||
@echo ' lint - run linter' | ||
@echo ' check-deps - check docs/LICENSE_OF_DEPENDENCIES.md' | ||
@echo ' clean - delete build artifacts' | ||
@echo ' all - download dependencies and compile telegraf binary' | ||
@echo ' deps - download dependencies' | ||
@echo ' telegraf - compile telegraf binary' | ||
@echo ' test - run short unit tests' | ||
@echo ' fmt - format source files' | ||
@echo ' tidy - tidy go modules' | ||
@echo ' lint - run linter' | ||
@echo ' lint-branch - run linter on changes in current branch since master' | ||
@echo ' lint-install - install linter' | ||
@echo ' check-deps - check docs/LICENSE_OF_DEPENDENCIES.md' | ||
@echo ' clean - delete build artifacts' | ||
@echo '' | ||
@echo 'Package Targets:' | ||
@$(foreach dist,$(dists),echo " $(dist)";) | ||
|
@@ -131,14 +133,28 @@ vet: | |
exit 1; \ | ||
fi | ||
|
||
.PHONY: lint-install | ||
lint-install: | ||
|
||
go install github.com/golangci/golangci-lint/cmd/[email protected] | ||
|
||
.PHONY: lint | ||
lint: | ||
ifeq (, $(shell which golangci-lint)) | ||
$(info golangci-lint can't be found, please install it: https://golangci-lint.run/usage/install/) | ||
$(info golangci-lint can't be found, please run: make lint-install) | ||
exit 1 | ||
endif | ||
|
||
golangci-lint run | ||
|
||
.PHONY: lint-branch | ||
lint-branch: | ||
ifeq (, $(shell which golangci-lint)) | ||
$(info golangci-lint can't be found, please run: make lint-install) | ||
exit 1 | ||
endif | ||
|
||
golangci-lint -v run | ||
golangci-lint run --new-from-rev master | ||
|
||
.PHONY: tidy | ||
tidy: | ||
|