gapr/.golangci.yml
Peter ec31dd14d4
All checks were successful
concourse-ci/lint/golangci-lint Lint Go files
refactor: apply golangci-lint findings
2023-01-31 21:14:34 +01:00

143 lines
2.7 KiB
YAML

linters-settings:
dupl:
threshold: 100
funlen:
lines: 100
statements: 50
gci:
local-prefixes: code.icb4dc0.de/prskr/gapr
gosec:
excludes:
- G404
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/gapr
golint:
min-confidence: 0
gomnd:
settings:
mnd:
# don't include the "operation" and "assign"
checks:
- argument
- case
- condition
- return
gomoddirectives:
replace-allow-list: [ ]
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: [ ]
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: false # don't require nolint directives to be specific about which linter is being skipped
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
- paralleltest
- prealloc
- predeclared
- promlinter
- staticcheck
- stylecheck
- 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
- dupl
- path: magefiles/.*\.go
linters:
- typecheck
run:
build-tags: [ ]
skip-dirs: [ ]
skip-files:
- ".*\\.pb\\.go$"
- ".*.mock.\\.go$"
modules-download-mode: readonly
go: "1.18"
timeout: 10m