-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace golint with golangci-lint (#139)
* Replace golint with golangci-lint * Fix linting: context should be first argument * Fix linting: unused-parameter consider removing or renaming it as _ * Fix linting: error-naming: error var should have form errFoo * Fix linting: should omit nil check * Fix linting: unnecessary nil check * Fix linting: argument is overwritten before first use * Fix linting: ineffectual assignment * Fix linting: use strings equalFold * Fix linting: use simple channel * Fix linting: simplify return bool statement * Fix linting: exclude deprectation warnings * Fix .golangci.yaml file path * Fix packages to lint path * Add GOPATH * rm GOPATH * Complete source path * Fix golangci-lint call * Fix changes after rebase * Update .golangci.yaml * Rename unused function param to _
- Loading branch information
Showing
22 changed files
with
185 additions
and
170 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,49 @@ | ||
run: | ||
concurrency: 4 | ||
timeout: 10m | ||
|
||
linters: | ||
disable: | ||
- unused | ||
enable: | ||
- revive | ||
- loggercheck | ||
|
||
issues: | ||
exclude-use-default: false | ||
exclude: | ||
# errcheck: Almost all programs ignore errors on these functions and in most cases it's ok | ||
- Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*printf?|os\.(Un)?Setenv). is not checked | ||
# revive: | ||
- var-naming # ((var|const|struct field|func) .* should be .* | ||
- dot-imports # should not use dot imports | ||
- package-comments # package comment should be of the form | ||
- unexported-return # exported func .* returns unexported type .*, which can be annoying to use | ||
- indent-error-flow # if block ends with a return statement, so drop this else and outdent its block | ||
- "exported: (type|func) name will be used as .* by other packages, and that stutters;" | ||
# typecheck: | ||
- "undeclared name: `.*`" | ||
- "\".*\" imported but not used" | ||
# allow non-capitalized messages if they start with technical terms | ||
- "structured logging message should be capitalized: \"garden(er-apiserver|er-controller-manager|er-admission-controller|er-operator|er-resource-manager|let)" | ||
exclude-rules: | ||
- linters: | ||
- staticcheck | ||
text: "SA1019:" # Excludes messages where deprecated variables are used | ||
|
||
exclude-files: | ||
- "zz_generated\\..*\\.go$" | ||
|
||
linters-settings: | ||
revive: | ||
rules: | ||
- name: duplicated-imports | ||
- name: unused-parameter | ||
- name: unreachable-code | ||
- name: context-as-argument | ||
- name: early-return | ||
- name: exported | ||
loggercheck: | ||
no-printf-like: true | ||
logr: true | ||
zap: true |
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.