2 Star 8 Fork 0

rancher / submariner

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
.golangci.yml 5.31 KB
一键复制 编辑 原始数据 按行查看 历史
Stephen Kitt 提交于 2023-06-14 14:01 . Disable depguard
---
linters-settings:
gocritic:
enabled-tags:
- diagnostic
- opinionated
- performance
- style
disabled-checks:
- ifElseChain
- unnamedResult
gocyclo:
min-complexity: 15
goheader:
template: |-
SPDX-License-Identifier: Apache-2.0
Copyright Contributors to the Submariner project.
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:
- fieldalignment
lll:
line-length: 140
wsl:
# Separating explicit var declarations by blank lines seems excessive.
allow-cuddle-declarations: true
linters:
disable-all: true
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- containedctx
- contextcheck
# - cyclop # This is equivalent to gocyclo
- decorder
# - depguard # depguard now denies by default, it should only be enabled if we actually use it
- dogsled
- dupl
- dupword
- durationcheck
- errcheck
- errchkjson
- errorlint
- errname
# - execinquery # No SQL
- exhaustive
# - exhauststruct # Not recommended for general use - meant to be used only for special cases
- exportloopref
# - forbidigo # We don't forbid any statements
# - forcetypeassert # There are many unchecked type assertions that would be the result of a programming error so the
# reasonable recourse would be to panic anyway if checked so this doesn't seem useful
# - funlen # gocyclo is enabled which is generally a better metric than simply LOC.
- gci
- ginkgolinter
# - gochecknoglobals # We don't want to forbid global variable constants
# - gochecknoinits # We use init functions for valid reasons
- gocognit
- goconst
- gocritic
- gocyclo
- goerr113
- godot
# - godox # Let's not forbid inline TODOs, FIXMEs et al
- gofmt
- gofumpt
- goheader
- goimports
# - gomnd # It doesn't seem useful in general to enforce constants for all numeric values
# - gomoddirectives # We don't want to forbid the 'replace' directive
# - gomodguard # We don't block any modules
# - goprintffuncname # This doesn't seem useful at all
- gosec
- gosimple
- govet
- grouper
- importas
- ineffassign
# - interfacebloat # We track complexity elsewhere
# - ireturn # The argument to always "Return Concrete Types" doesn't seem compelling. It is perfectly valid to return
# an interface to avoid exposing the entire underlying struct
- lll
- loggercheck
- maintidx
- makezero
- misspell
- nakedret
# - nestif # This calculates cognitive complexity but we're doing that elsewhere
- nilerr
- nilnil
# - nlreturn # This is reasonable with a block-size of 2 but setting it above isn't honored
# - noctx # We don't send HTTP requests
- nolintlint
# - nonamedreturns # We don't forbid named returns
- nosprintfhostport
# - paralleltest # Not relevant for Ginkgo UTs
- prealloc
- predeclared
- promlinter
- reassign
- revive
# - rowserrcheck # We don't use SQL
# - sqlclosecheck # We don't use SQL
- staticcheck
- stylecheck
# - tagliatelle # Inconsistent with stylecheck and not as good
# - tenv # Not relevant for our Ginkgo UTs
- testableexamples
- testpackage
# - thelper # Not relevant for our Ginkgo UTs
# - tparallel # Not relevant for our Ginkgo UTs
- typecheck
- unconvert
- unparam
- unused
- usestdlibvars
# - varnamelen # It doesn't seem necessary to enforce a minimum variable name length
- wastedassign
- whitespace
- wrapcheck
- wsl
issues:
exclude-rules:
# Allow dot-imports for Gomega BDD directives per idiomatic Gomega
- linters:
- revive
- stylecheck
text: "dot imports"
source: "gomega"
# Allow dot-imports for Ginkgo BDD directives per idiomatic Ginkgo
- linters:
- revive
- stylecheck
text: "dot imports"
source: "ginkgo"
# Ignore pointer bytes in struct alignment tests (this is a very
# minor optimisation)
- linters:
- govet
text: "pointer bytes could be"
# Full text of the error is "do not define dynamic errors, use wrapped static errors instead". See
# https://github.com/Djarvur/go-err113/issues/10 for an interesting discussion of this error. While there are cases
# where wrapped sentinel errors are useful, it seems a bit pedantic to force that pattern in all cases.
- linters:
- goerr113
text: "do not define dynamic errors"
# Ignore certain linters for test files
- path: _test\.go|test/|fake/
linters:
- gochecknoinits
- goerr113
- wrapcheck
# Ignore contextcheck on main for now
- path: main.go
linters:
- contextcheck
Go
1
https://gitee.com/rancher/submariner.git
git@gitee.com:rancher/submariner.git
rancher
submariner
submariner
devel

搜索帮助