This repository has been archived on 2023-11-25. You can view files and clone it, but cannot push or open issues or pull requests.
kreaper/.golangci.yml
Peter Kurfer 618e114b08
All checks were successful
agola/kreaper/Test and lint The run finished successfully
refactor: move to custom Gitea
2022-09-22 10:54:06 +02:00

146 lines
2.8 KiB
YAML

linters-settings:
dupl:
threshold: 100
funlen:
lines: 100
statements: 50
gci:
local-prefixes: code.icb4dc0.de/prskr/kreaper
goconst:
min-len: 2
min-occurrences: 2
gocritic:
enabled-tags:
- diagnostic
- opinionated
- performance
disabled-checks:
- ifElseChain
- octalLiteral
- wrapperFunc
# see https://github.com/golangci/golangci-lint/issues/2649
- hugeParam
- rangeValCopy
# settings:
# hugeParam:
# sizeThreshold: 200
gocyclo:
min-complexity: 15
goimports:
local-prefixes: code.icb4dc0.de/prskr/kreaper
golint:
min-confidence: 0
gomnd:
settings:
mnd:
# don't include the "operation" and "assign"
checks:
- argument
- case
- condition
- return
gomoddirectives:
replace-allow-list:
# pin versions
- k8s.io/api
- k8s.io/apiextensions-apiserver
- k8s.io/apimachinery
- k8s.io/client-go
- k8s.io/component-base
govet:
check-shadowing: true
enable-all: true
disable:
- fieldalignment
# see https://github.com/golangci/golangci-lint/issues/2649
- nilness
- unusedwrite
importas:
no-unaliased: true
alias:
- pkg: (k8s.io/api|k8s.io/apimachinery/pkg/apis)/([A-z0-9]+)/([A-z0-9]+)
alias: $2$3
lll:
line-length: 140
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: true
linters:
disable-all: true
enable:
- contextcheck
- dogsled
- dupl
- errcheck
- errchkjson
- errname
- errorlint
- exhaustive
- exportloopref
- funlen
- gocognit
- goconst
- gocritic
- gocyclo
- godox
- gofumpt
- goimports
- gomoddirectives
- gomnd
- gosec
# - gosimple
- govet
- importas
- ineffassign
- ireturn
- lll
- misspell
- nakedret
- nestif
- nilnil
- noctx
- nolintlint
- nosprintfhostport
- paralleltest
- prealloc
- predeclared
- promlinter
# - staticcheck
# - stylecheck
- tenv
- testpackage
- thelper
- typecheck
- unconvert
- unparam
- whitespace
- unused
- wastedassign
issues:
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
- path: _test\.go
linters:
- dupl
- funlen
- gocognit
- gomnd
- govet
- path: magefiles/
linters:
- deadcode
run:
go: "1.18"
skip-files:
- ".*.mock.\\.go$"
modules-download-mode: readonly
timeout: 5m