-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use golangci-lint for linting (#2034)
* Use golangci-lint for linting Rebase Signed-off-by: Ed Snible <[email protected]> * add golangci-lint to install tools Signed-off-by: Ed Snible <[email protected]> * Allow small drops in coverage Signed-off-by: Ed Snible <[email protected]> * Use Go 1.18 for linting, clean .golintci.yml removing things not needed for operator Signed-off-by: Ed Snible <[email protected]> * Use nolint directive instead of suppressing context return Signed-off-by: Ed Snible <[email protected]> Signed-off-by: Ed Snible <[email protected]>
- Loading branch information
Showing
90 changed files
with
382 additions
and
407 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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
run: | ||
go: '1.18' | ||
timeout: 10m | ||
|
||
linters-settings: | ||
goimports: | ||
local-prefixes: github.com/jaegertracing/jaeger-operator | ||
gosimple: | ||
go: "1.18" | ||
|
||
linters: | ||
enable: | ||
- depguard | ||
- gofmt | ||
- gofumpt | ||
- goimports | ||
- gosec | ||
- govet | ||
- misspell | ||
- bidichk | ||
disable: | ||
- errcheck | ||
|
||
issues: | ||
# Excluding configuration per-path, per-linter, per-text and per-source | ||
exclude-rules: | ||
# Exclude some linters from running on tests files. | ||
- path: _test\.go | ||
linters: | ||
- gosec |
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 |
---|---|---|
|
@@ -118,6 +118,7 @@ PHONY: lint | |
lint: | ||
$(ECHO) Linting... | ||
$(VECHO)GOPATH=${GOPATH} ./.ci/lint.sh | ||
golangci-lint -v run | ||
|
||
.PHONY: vet | ||
vet: ## Run go vet against code. | ||
|
@@ -437,6 +438,7 @@ tools: kustomize controller-gen operator-sdk | |
|
||
.PHONY: install-tools | ||
install-tools: operator-sdk | ||
go install github.com/golangci/golangci-lint/cmd/[email protected] | ||
$(VECHO)${GO_FLAGS} ./.ci/vgot.sh \ | ||
golang.org/x/lint/golint \ | ||
golang.org/x/tools/cmd/goimports | ||
|
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 |
---|---|---|
|
@@ -186,5 +186,4 @@ func TestRepetitiveArguments(t *testing.T) { | |
|
||
assert.Len(t, args, 3) | ||
assert.Equal(t, expected, args) | ||
|
||
} |
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
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
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
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
Oops, something went wrong.