forked from networkservicemesh/networkservicemesh
-
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.
Use golangci-lint (networkservicemesh#1054)
* Use golangci-lint - Auto fix by goimprotrs - Updated guide-build.md - Disable deprecated linter - Run static code analysis in a separate job Signed-off-by: denis-tingajkin <[email protected]>
- Loading branch information
1 parent
5b32efc
commit 6e2d22d
Showing
101 changed files
with
509 additions
and
239 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,104 @@ | ||
run: | ||
concurrency: 4 | ||
deadline: 15m | ||
issues-exit-code: 1 | ||
|
||
tests: true | ||
|
||
skip-dirs: | ||
- build | ||
- conf | ||
- controlplane/scripts | ||
- dataplane/vppagent/build | ||
- dataplane/vppagent/conf | ||
- dataplane/scripts | ||
- deployments | ||
- docks | ||
- scripts | ||
|
||
linters-settings: | ||
errcheck: | ||
check-type-assertions: false | ||
check-blank: false | ||
|
||
govet: | ||
check-shadowing: true | ||
|
||
settings: | ||
printf: | ||
funcs: | ||
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof | ||
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf | ||
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf | ||
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf | ||
golint: | ||
min-confidence: 0.8 | ||
goimports: | ||
local-prefixes: github.com/networkservicemesh/networkservicemesh | ||
gocyclo: | ||
min-complexity: 20 | ||
maligned: | ||
suggest-new: true | ||
dupl: | ||
threshold: 100 | ||
goconst: | ||
min-len: 3 | ||
min-occurrences: 3 | ||
depguard: | ||
list-type: blacklist | ||
include-go-root: false | ||
packages: | ||
- github.com/davecgh/go-spew/spew | ||
misspell: | ||
locale: US | ||
unused: | ||
check-exported: true | ||
unparam: | ||
check-exported: true | ||
nakedret: | ||
max-func-lines: 30 | ||
prealloc: | ||
simple: true | ||
range-loops: true | ||
for-loops: false | ||
gocritic: | ||
enabled-checks: | ||
- rangeValCopy | ||
- boolExprSimplify | ||
- badCond | ||
- methodExprCall | ||
- paramTypeCombine | ||
- ptrToRefParam | ||
- rangeExprCopy | ||
- captLocal | ||
- caseOrder | ||
- defaultCaseOrder | ||
- dupBranchBody | ||
- dupSubExpr | ||
- elseif | ||
- emptyFallthrough | ||
- emptyStringTest | ||
- equalFold | ||
- indexAlloc | ||
- nestingReduce | ||
- nilValReturn | ||
- yodaStyleExpr | ||
settings: | ||
captLocal: | ||
paramsOnly: true | ||
rangeValCopy: | ||
sizeThreshold: 32 | ||
|
||
linters: | ||
disable: | ||
- lll | ||
- gofmt | ||
- unused #deprecated | ||
enable-all: true | ||
|
||
issues: | ||
exclude-use-default: false | ||
max-issues-per-linter: 0 | ||
max-same-issues: 0 | ||
exclude: | ||
- should not use dot imports |
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,15 @@ | ||
.PHONY: lint-fix | ||
lint-fix: | ||
golangci-lint run --new-from-rev=origin/master --fix | ||
|
||
.PHONY: lint-install | ||
lint-install: | ||
go get github.com/golangci/golangci-lint/cmd/[email protected] | ||
|
||
.PHONY: lint-check-diff | ||
lint-check-diff: | ||
golangci-lint run --new-from-rev=origin/master | ||
|
||
.PHONY: lint-check-all | ||
lint-check-all: | ||
golangci-lint run ./... |
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
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.