-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* lint: Integrate golangcilint Signed-off-by: Quique Llorente <[email protected]> * lint: Fix deadcode Signed-off-by: Quique Llorente <[email protected]> * lint: Exclude dupl from tests Signed-off-by: Quique Llorente <[email protected]> * lint: fix errcheck Signed-off-by: Quique Llorente <[email protected]> * lint: fix gochecknoinits Signed-off-by: Quique Llorente <[email protected]> * lint: Fix gocritic Signed-off-by: Quique Llorente <[email protected]> * lint: fix gocyclo Signed-off-by: Quique Llorente <[email protected]> * lint: fix gofmt Signed-off-by: Quique Llorente <[email protected]> * lint: fix gomnd Signed-off-by: Quique Llorente <[email protected]> * lint: fix gosec Signed-off-by: Quique Llorente <[email protected]> * lint: fix govet Signed-off-by: Quique Llorente <[email protected]> * lint: fix misspell Signed-off-by: Quique Llorente <[email protected]> * lint: fix stylecheck Signed-off-by: Quique Llorente <[email protected]> * lint: fix unconvert Signed-off-by: Quique Llorente <[email protected]> * lint: fix unparam Signed-off-by: Quique Llorente <[email protected]> * lint: fix whitespace Signed-off-by: Quique Llorente <[email protected]> * lint: fix lint for webhook server Signed-off-by: Quique Llorente <[email protected]> * lint: fix lll Signed-off-by: Quique Llorente <[email protected]> * lint: fix goheader Signed-off-by: Quique Llorente <[email protected]>
- Loading branch information
Showing
28 changed files
with
694 additions
and
311 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,114 @@ | ||
# Copyright 2021 The NMPolicy Authors. | ||
# | ||
# 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. | ||
# | ||
|
||
|
||
linters-settings: | ||
dupl: | ||
threshold: 100 | ||
funlen: | ||
lines: 100 | ||
statements: 50 | ||
gci: | ||
local-prefixes: github.com/qinqon/kube-admisssion-webhook | ||
goconst: | ||
min-len: 2 | ||
min-occurrences: 2 | ||
gocritic: | ||
enabled-tags: | ||
- diagnostic | ||
- experimental | ||
- opinionated | ||
- performance | ||
- style | ||
disabled-checks: | ||
- dupImport # https://github.com/go-critic/go-critic/issues/845 | ||
- ifElseChain | ||
- octalLiteral | ||
- whyNoLint | ||
- wrapperFunc | ||
gocyclo: | ||
min-complexity: 15 | ||
goheader: | ||
values: | ||
regexp: | ||
year-regexp: 2\d\d\d | ||
template-path: header.tpl | ||
goimports: | ||
local-prefixes: github.com/qinqon/kube-admisssion-webhook | ||
gomnd: | ||
settings: | ||
mnd: | ||
# don't include the "operation" and "assign" | ||
checks: argument,case,condition,return | ||
govet: | ||
check-shadowing: true | ||
lll: | ||
line-length: 140 | ||
maligned: | ||
suggest-new: true | ||
misspell: | ||
locale: US | ||
nolintlint: | ||
allow-leading-space: true # don't require machine-readable nolint directives (i.e. with no leading space) | ||
allow-unused: false # report any unused nolint directives | ||
require-explanation: false # don't require an explanation for nolint directives | ||
require-specific: false # don't require nolint directives to be specific about which linter is being skipped | ||
|
||
issues: | ||
exclude-rules: | ||
- path: _test.go | ||
linters: | ||
- dupl | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- bodyclose | ||
- deadcode | ||
- depguard | ||
- dogsled | ||
- dupl | ||
- errcheck | ||
- exportloopref | ||
- exhaustive | ||
- funlen | ||
- gochecknoinits | ||
- goconst | ||
- gocritic | ||
- gocyclo | ||
- gofmt | ||
- goheader | ||
- goimports | ||
- gomnd | ||
- goprintffuncname | ||
- gosec | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- lll | ||
- misspell | ||
- nakedret | ||
- noctx | ||
- nolintlint | ||
- rowserrcheck | ||
- staticcheck | ||
- structcheck | ||
- stylecheck | ||
- typecheck | ||
- unconvert | ||
- unparam | ||
- unused | ||
- varcheck | ||
- whitespace |
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,8 @@ | ||
#!/bin/bash -xe | ||
|
||
golangci_lint_version=v1.42.1 | ||
if [ ! -f $(go env GOPATH)/bin/golangci-lint ]; then | ||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin $golangci_lint_version | ||
fi | ||
golangci-lint run | ||
|
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,13 @@ | ||
* Copyright {{ year-regexp }} Kube Admission Webhook Authors. | ||
* | ||
* 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. |
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.