-
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.
- Loading branch information
Alex Sowitzki
committed
Oct 21, 2023
1 parent
03809c6
commit 1a451ae
Showing
17 changed files
with
312 additions
and
113 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,9 +1,166 @@ | ||
linters: | ||
disable-all: true | ||
# One can't use disable and disable-all. disable-all is preferred to avoid lint failing when golangci gets updated and linters are added. | ||
# at the same time but it is nice to explicitly state which linters we do not want. | ||
#disable: | ||
#- containedctx # Context.Context within a struct a struct (as opposed to a func parameter) is nasty for many reasons, but actually sometimes useful. | ||
#- contextcheck # Not that useful/false positives. | ||
#- cyclop # Cyclo complexity already calculated by other linters. | ||
#- depguard # We do not restrict imports. | ||
#- dogsled # Could be nice in the future. | ||
#- dupl # Could be nice in the future. | ||
#- exhaustive # Not that useful/false positives. | ||
#- exhaustruct # Not that useful/false positives. | ||
#- forcetypeassert # We want a panic in situations when a type is asserted. | ||
#- funlen # We really like long functions. | ||
#- gci # Conflicts with other linters. | ||
#- gochecknoglobals # We need globals. | ||
#- gochecknoinits # We have a lot of those. | ||
#- gocognit # Not that useful/false positives. | ||
#- godox # Not that useful/false positives. | ||
#- gomnd # The annoy is strong. | ||
#- gomoddirectives # Not that useful/false positives. | ||
#- interfacebloat # WE do bloaty interfaces. | ||
#- inamedparam # Not that useful. | ||
#- ireturn # Not that useful/false positives. | ||
#- musttag # Dislikes our deps. | ||
#- nakedret # Naked return good return. | ||
#- nlreturn # Could be nice in the future. | ||
#- nonamedreturns # Named return good return. | ||
#- rowserrcheck # No SQL here. | ||
#- sqlclosecheck # No SQL here. | ||
#- testpackage # Could be nice in the future. | ||
#- unparam # Not that useful/false positives. | ||
#- varnamelen # Not that useful/false positives. | ||
#- wrapcheck # Not that useful/false positives. | ||
#- wsl # Not that useful/false positives. | ||
#- zerologlint # No zerolog here. | ||
enable: | ||
- asasalint | ||
- asciicheck | ||
- bidichk | ||
- bodyclose | ||
- decorder | ||
- dupword | ||
- durationcheck | ||
- errcheck | ||
- errchkjson | ||
- errname | ||
- errorlint | ||
- execinquery | ||
- exportloopref | ||
- forbidigo | ||
- ginkgolinter | ||
- gocheckcompilerdirectives | ||
- gochecksumtype | ||
- goconst | ||
- gocritic | ||
- gocyclo | ||
- godot | ||
- goerr113 | ||
- gofmt | ||
- gofumpt | ||
- goheader | ||
- goimports | ||
- gosmopolitan | ||
- govet | ||
- grouper | ||
- importas | ||
- ineffassign | ||
- lll | ||
- loggercheck | ||
- maintidx | ||
- makezero | ||
- mirror | ||
- misspell | ||
- musttag | ||
- nestif | ||
- nilerr | ||
- nilnil | ||
disable: | ||
- scopelint # deprecated | ||
- exhaustive # was creating false positives left and right | ||
presets: | ||
- bugs | ||
- noctx | ||
- nolintlint | ||
- nosprintfhostport | ||
- paralleltest | ||
- perfsprint | ||
- prealloc | ||
- predeclared | ||
- promlinter | ||
- protogetter | ||
- reassign | ||
- revive | ||
- sloglint | ||
- staticcheck | ||
- stylecheck | ||
- tagalign | ||
- tagliatelle | ||
- tenv | ||
- testableexamples | ||
- testifylint | ||
- thelper | ||
- tparallel | ||
- typecheck | ||
- unconvert | ||
- unused | ||
- usestdlibvars | ||
- wastedassign | ||
- whitespace | ||
issues: | ||
max-same-issues: 0 | ||
max-issues-per-linter: 0 | ||
include: | ||
- EXC0001 # Check errors returned by io.Closer. | ||
- EXC0002 # Require docs on exported pkg. | ||
- EXC0003 # Just don't name a test pkg `test`. | ||
- EXC0004 # Unsafe pkg is scary. | ||
- EXC0005 # No ineffectual breaks. | ||
- EXC0006 # Unsafe pkg is scary. | ||
#- EXC0007 # Launching a subprocess using variables is not that odd. | ||
#- EXC0008 # Duplicated check. | ||
#- EXC0009 # World readable files are actually not a CVE | ||
#- EXC0010 # Reading a file with a non literal path is not a CVE either. | ||
- EXC0011 # Docs. | ||
- EXC0012 # Docs. | ||
- EXC0013 # Docs. | ||
- EXC0014 # Docs. | ||
- EXC0015 # Docs. | ||
run: | ||
skip-files: [ "zz_generated.deepcopy.go$" ] | ||
linters-settings: | ||
goimports: | ||
local-prefixes: github.com/mt-sre/devkube | ||
importas: | ||
no-unaliased: false | ||
no-extra-aliases: true | ||
alias: | ||
- pkg: k8s\.io\/api\/([^\/]+)\/([^\/]+) | ||
alias: $1$2 | ||
- pkg: k8s\.io\/apimachinery\/pkg\/([^\/]+) | ||
alias: $1 | ||
- pkg: k8s\.io\/apimachinery\/pkg\/apis\/([^\/]+)\/([^\/]+) | ||
alias: $1$2 | ||
- pkg: package-operator\.run\/apis | ||
alias: apis | ||
- pkg: package-operator\.run\/apis\/([^\/]+)\/([^\/]+) | ||
alias: $1$2 | ||
- pkg: k8s\.io\/apiextensions-apiserver\/pkg\/apis\/([^\/]+)\/([^\/]+) | ||
alias: $1$2 | ||
- pkg: github\.com\/openshift\/api\/([^\/]+)\/([^\/]+) | ||
alias: $1$2 | ||
- pkg: package-operator.run/internal/controllers/hostedclusters/([^\/]+)\/([^\/]+) | ||
alias: $1$2 | ||
- pkg: k8s\.io\/apimachinery\/pkg\/api\/([^\/]+) | ||
alias: apimachinery$1 | ||
- pkg: sigs\.k8s\.io\/controller-runtime | ||
alias: ctrl | ||
- pkg: package-operator\.run\/internal\/cmd | ||
alias: internalcmd | ||
- pkg: package-operator\.run\/internal\/probing | ||
alias: internalprobing | ||
- pkg: github\.com\/google\/go-containerregistry\/pkg\/v1 | ||
alias: containerregistrypkgv1 | ||
- pkg: k8s\.io\/utils\/clock\/testing | ||
alias: clocktesting | ||
- pkg: k8s\.io\/apiserver\/pkg\/cel | ||
alias: apiservercel | ||
- pkg: k8s\.io\/apiserver\/pkg\/apis\/cel | ||
alias: apiserverapiscel |
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.