-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Mateus Oliveira <[email protected]>
- Loading branch information
1 parent
afb3611
commit 8d07f9f
Showing
25 changed files
with
1,002 additions
and
800 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 |
---|---|---|
@@ -1,40 +1,129 @@ | ||
# Documentation reference https://github.com/golangci/golangci-lint/blob/v1.56.2/.golangci.reference.yml | ||
run: | ||
deadline: 5m | ||
skip-dirs-use-default: false | ||
modules-download-mode: readonly | ||
allow-parallel-runners: true | ||
skip-dirs: | ||
- test/* | ||
|
||
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/migtools/oadp-non-admin) | ||
goconst: | ||
min-len: 3 | ||
min-occurrences: 5 | ||
gofmt: | ||
simplify: true | ||
goheader: | ||
# copy from ./hack/boilerplate.go.txt | ||
template: |- | ||
Copyright 2024. | ||
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: | ||
enable-all-rules: true | ||
rules: | ||
- name: line-length-limit | ||
disabled: true | ||
- name: function-length | ||
disabled: true | ||
# TODO remove | ||
- name: cyclomatic | ||
disabled: true | ||
- name: cognitive-complexity | ||
disabled: true | ||
unparam: | ||
check-exported: true | ||
|
||
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: | ||
- path: "api/*" | ||
linters: | ||
- lll | ||
- path: "internal/*" | ||
linters: | ||
- dupl | ||
- lll | ||
linters: | ||
disable-all: true | ||
enable: | ||
- dupl | ||
- asasalint | ||
- asciicheck | ||
- bidichk | ||
- bodyclose | ||
- dogsled | ||
- dupword | ||
- durationcheck | ||
- errcheck | ||
- errchkjson | ||
- exportloopref | ||
- gci | ||
- ginkgolinter | ||
- goconst | ||
- gocyclo | ||
- gofmt | ||
- goimports | ||
- goheader | ||
- goprintffuncname | ||
- gosec | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- lll | ||
- misspell | ||
- nakedret | ||
- prealloc | ||
- nilerr | ||
- noctx | ||
- nolintlint | ||
- nosprintfhostport | ||
- revive | ||
- staticcheck | ||
- typecheck | ||
- 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: | ||
- revive | ||
text: "^add-constant: avoid magic numbers like '0', create a named constant for it$" | ||
- linters: | ||
- revive | ||
text: "^add-constant: avoid magic numbers like '1', create a named constant for it$" | ||
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
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,31 @@ | ||
/* | ||
Copyright 2024. | ||
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. | ||
*/ | ||
|
||
// Package constant contains all common constants used in the project | ||
package constant | ||
|
||
// Common labels for objects manipulated by the Non Admin Controller | ||
// Labels should be used to identify the NAC backup | ||
// Annotations on the other hand should be used to define ownership | ||
// of the specific Object, such as Backup. | ||
const ( | ||
OadpLabel = "openshift.io/oadp" // TODO import? | ||
ManagedByLabel = "app.kubernetes.io/managed-by" | ||
ManagedByLabelValue = "oadp-nac-controller" // TODO why not use same project name as in PROJECT file? | ||
NabOriginNameAnnotation = "openshift.io/oadp-nab-origin-name" | ||
NabOriginNamespaceAnnotation = "openshift.io/oadp-nab-origin-namespace" | ||
NabOriginUUIDAnnotation = "openshift.io/oadp-nab-origin-uuid" | ||
) |
Oops, something went wrong.