forked from openshift/oadp-operator
-
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.
feat: Add golangci-lint linters - imports (openshift#1337)
* feat: Add golangci-lint Signed-off-by: Mateus Oliveira <msouzaol@redhat.com> * fixup! feat: Add golangci-lint Signed-off-by: Mateus Oliveira <msouzaol@redhat.com> * fixup! feat: Add golangci-lint Signed-off-by: Mateus Oliveira <msouzaol@redhat.com> * fixup! feat: Add golangci-lint Signed-off-by: Mateus Oliveira <msouzaol@redhat.com> * fixup! feat: Add golangci-lint Signed-off-by: Mateus Oliveira <msouzaol@redhat.com> * fixup! feat: Add golangci-lint Signed-off-by: Mateus Oliveira <msouzaol@redhat.com> * fixup! feat: Add golangci-lint Signed-off-by: Mateus Oliveira <msouzaol@redhat.com> * fixup! feat: Add golangci-lint Signed-off-by: Mateus Oliveira <msouzaol@redhat.com> * fixup! feat: Add golangci-lint Signed-off-by: Mateus Oliveira <msouzaol@redhat.com> --------- Signed-off-by: Mateus Oliveira <msouzaol@redhat.com> (cherry picked from commit 76f0049)
- Loading branch information
1 parent
d19a993
commit 063bf8e
Showing
45 changed files
with
1,048 additions
and
866 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 |
---|---|---|
@@ -0,0 +1,126 @@ | ||
# Documentation reference https://github.com/golangci/golangci-lint/blob/v1.55.2/.golangci.reference.yml | ||
run: | ||
skip-dirs-use-default: false | ||
modules-download-mode: readonly | ||
allow-parallel-runners: false | ||
|
||
output: | ||
format: colored-line-number | ||
print-issued-lines: true | ||
print-linter-name: true | ||
uniq-by-line: true | ||
sort-results: true | ||
|
||
linters-settings: | ||
dogsled: | ||
max-blank-identifiers: 2 | ||
errcheck: | ||
check-type-assertions: true | ||
check-blank: true | ||
gci: | ||
sections: | ||
- standard | ||
- default | ||
- prefix(github.com/openshift/oadp-operator) | ||
goconst: | ||
min-len: 3 | ||
min-occurrences: 5 | ||
gofmt: | ||
simplify: true | ||
goheader: | ||
# copy from ./hack/boilerplate.go.txt | ||
template: |- | ||
Copyright 2021. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
govet: | ||
enable-all: true | ||
misspell: | ||
locale: US | ||
nakedret: | ||
max-func-lines: 30 | ||
nolintlint: | ||
allow-unused: false | ||
allow-no-explanation: [] | ||
require-explanation: true | ||
require-specific: true | ||
revive: | ||
# TODO enable! | ||
# enable-all-rules: true | ||
rules: | ||
- name: line-length-limit | ||
disabled: true | ||
# TODO delete after | ||
- name: blank-imports | ||
- name: dot-imports | ||
- name: duplicated-imports | ||
- name: import-alias-naming | ||
- name: import-shadowing | ||
- name: redundant-import-alias | ||
unparam: | ||
check-exported: true | ||
|
||
linters: | ||
disable-all: true | ||
# TODO enable commented ones | ||
enable: | ||
- asasalint | ||
- asciicheck | ||
- bidichk | ||
# - bodyclose | ||
- dogsled | ||
# - dupword | ||
# - durationcheck | ||
# - errcheck | ||
- errchkjson | ||
- exportloopref | ||
- gci | ||
# - ginkgolinter | ||
# - goconst | ||
- gofmt | ||
# - goheader | ||
- goprintffuncname | ||
# - gosec | ||
# - gosimple | ||
# - govet | ||
# - ineffassign | ||
# - misspell | ||
- nakedret | ||
# - nilerr | ||
# - noctx | ||
- nolintlint | ||
- nosprintfhostport | ||
- revive | ||
# - staticcheck | ||
# - stylecheck | ||
# - unconvert | ||
# - unparam | ||
# - unused | ||
- usestdlibvars | ||
fast: false | ||
|
||
issues: | ||
exclude-use-default: false | ||
exclude-rules: | ||
- linters: | ||
- revive | ||
text: "^struct-tag: unknown option 'inline' in JSON tag$" | ||
- linters: | ||
- stylecheck | ||
text: "ST1000:|ST1020:|ST1021:|ST1022:" | ||
max-issues-per-linter: 0 | ||
max-same-issues: 0 | ||
|
||
severity: | ||
default-severity: error | ||
case-sensitive: 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.