-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2279 from konstructio/golangci
Clean up code using GolangCI-Lint
- Loading branch information
Showing
59 changed files
with
1,237 additions
and
1,282 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,121 @@ | ||
run: | ||
tests: false | ||
concurrency: 5 | ||
timeout: 5m | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- staticcheck | ||
- unused | ||
- asasalint | ||
- asciicheck | ||
- bidichk | ||
- bodyclose | ||
- contextcheck | ||
- decorder | ||
- dogsled | ||
- dupl | ||
- dupword | ||
- durationcheck | ||
- errchkjson | ||
- errname | ||
- errorlint | ||
- exhaustive | ||
- copyloopvar | ||
- ginkgolinter | ||
- gocheckcompilerdirectives | ||
- gochecksumtype | ||
- gocritic | ||
- gocyclo | ||
- gofmt | ||
- gofumpt | ||
- goheader | ||
- goimports | ||
- gomodguard | ||
- goprintffuncname | ||
- gosec | ||
- gosmopolitan | ||
- grouper | ||
- importas | ||
- inamedparam | ||
- interfacebloat | ||
- ireturn | ||
- loggercheck | ||
- makezero | ||
- mirror | ||
- misspell | ||
- nakedret | ||
- nilerr | ||
- nilnil | ||
- nonamedreturns | ||
- nosprintfhostport | ||
- paralleltest | ||
- prealloc | ||
- predeclared | ||
- promlinter | ||
- protogetter | ||
- reassign | ||
- revive | ||
- rowserrcheck | ||
- sloglint | ||
- spancheck | ||
- sqlclosecheck | ||
- stylecheck | ||
- tenv | ||
- testableexamples | ||
- testifylint | ||
- testpackage | ||
- thelper | ||
- tparallel | ||
- unconvert | ||
- unparam | ||
- usestdlibvars | ||
- wastedassign | ||
- whitespace | ||
- wrapcheck | ||
- zerologlint | ||
|
||
linters-settings: | ||
perfsprint: | ||
int-conversion: false | ||
err-error: false | ||
errorf: true | ||
sprintf1: true | ||
strconcat: false | ||
|
||
ireturn: | ||
allow: | ||
- anon | ||
- error | ||
- empty | ||
- stdlib | ||
- ssh.PublicKey | ||
- tea.Model | ||
|
||
gosec: | ||
confidence: medium | ||
excludes: | ||
- G107 # Potential HTTP request made with variable url: these are often false positives or intentional | ||
- G110 # Decompression bombs: we can check these manually when submitting code | ||
- G306 # Poor file permissions used when creating a directory: we can check these manually when submitting code | ||
- G404 # Use of weak random number generator (math/rand instead of crypto/rand): we can live with these | ||
|
||
stylecheck: | ||
checks: | ||
- "all" | ||
- "-ST1003" # this is covered by a different linter | ||
|
||
gocyclo: | ||
min-complexity: 60 | ||
|
||
exhaustive: | ||
check-generated: false | ||
explicit-exhaustive-switch: false | ||
explicit-exhaustive-map: false | ||
default-case-required: false | ||
default-signifies-exhaustive: true | ||
package-scope-only: false |
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.