-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Updates for golangci-lint Switch config to be more consistent with other O-F repos. Fix lint issues. Signed-off-by: Andy Goldstein <andy.goldstein@redhat.com> * Make operator-lib imports last Signed-off-by: Andy Goldstein <andy.goldstein@redhat.com> --------- Signed-off-by: Andy Goldstein <andy.goldstein@redhat.com>
- Loading branch information
Showing
17 changed files
with
210 additions
and
160 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,77 @@ | ||
issues: | ||
# don't skip warning about doc comments | ||
# don't exclude the default set of lint | ||
exclude-use-default: false | ||
# restore some of the defaults | ||
# (fill in the rest as needed) | ||
exclude-rules: | ||
- linters: [errcheck] | ||
text: "Error return value of .((os\\.)?std(out|err)\\..*|.*Close|.*Flush|os\\.Remove(All)?|.*printf?|os\\.(Un)?Setenv). is not checked" | ||
run: | ||
# Default timeout is 1m, up to give more room | ||
timeout: 4m | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- nakedret | ||
- interfacer | ||
- varcheck | ||
- deadcode | ||
- structcheck | ||
- misspell | ||
- maligned | ||
- ineffassign | ||
- goconst | ||
- goimports | ||
- errcheck | ||
- unparam | ||
- golint | ||
- staticcheck | ||
- gosimple | ||
- unused | ||
- govet | ||
- typecheck | ||
- gocyclo | ||
- gofmt | ||
- dupl | ||
- asciicheck | ||
- bodyclose | ||
- errorlint | ||
- gofmt | ||
- goimports | ||
- gosec | ||
- importas | ||
- misspell | ||
- nestif | ||
- nonamedreturns | ||
- prealloc | ||
- revive | ||
- stylecheck | ||
- tparallel | ||
- unconvert | ||
- unparam | ||
- unused | ||
- whitespace | ||
|
||
run: | ||
deadline: 5m | ||
linters-settings: | ||
errorlint: | ||
errorf: false | ||
|
||
importas: | ||
alias: | ||
- pkg: k8s.io/apimachinery/pkg/apis/meta/v1 | ||
alias: metav1 | ||
- pkg: k8s.io/apimachinery/pkg/api/errors | ||
alias: apierrors | ||
- pkg: k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1 | ||
alias: apiextensionsv1 | ||
- pkg: k8s.io/apimachinery/pkg/util/runtime | ||
alias: utilruntime | ||
- pkg: "^k8s\\.io/api/([^/]+)/(v[^/]+)$" | ||
alias: $1$2 | ||
- pkg: sigs.k8s.io/controller-runtime | ||
alias: ctrl | ||
|
||
goimports: | ||
local-prefixes: github.com/operator-framework/operator-lib | ||
|
||
revive: | ||
ignore-generated-header: false | ||
severity: warning | ||
confidence: 0.8 | ||
rules: | ||
- name: blank-imports | ||
- name: context-as-argument | ||
- name: context-keys-type | ||
- name: error-return | ||
- name: error-strings | ||
- name: error-naming | ||
- name: exported | ||
- name: increment-decrement | ||
- name: var-naming | ||
- name: var-declaration | ||
- name: package-comments | ||
- name: range | ||
- name: receiver-naming | ||
- name: time-naming | ||
- name: unexported-return | ||
- name: indent-error-flow | ||
- name: errorf | ||
- name: empty-block | ||
- name: superfluous-else | ||
- name: unused-parameter | ||
- name: unreachable-code | ||
- name: redefines-builtin-id | ||
|
||
output: | ||
format: tab |
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.