buildr/.golangci.yml
Peter 34c431790e
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/tag Build is failing
refactor: use connect-go instead of regular Google gRPC
- support binary name for plugins
- register plugins for container jobs
2023-09-12 18:43:34 +02:00

155 lines
3 KiB
YAML

linters-settings:
dupl:
threshold: 100
funlen:
lines: 100
statements: 50
gci:
local-prefixes: code.icb4dc0.de/buildr/buildr
goconst:
min-len: 2
min-occurrences: 2
nestif:
min-complexity: 10
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/buildr/buildr
golint:
min-confidence: 0
gosec:
excludes:
# ignore path traversal with archive
- G305
# allow md5
- G401
- G501
gomnd:
settings:
mnd:
# don't include the "operation" and "assign"
checks:
- argument
- case
- condition
- return
gomoddirectives:
replace-allow-list:
- golang.org/x/net
govet:
check-shadowing: false
enable-all: true
disable:
- shadow
importas:
no-unaliased: true
alias:
- pkg: code.icb4dc0.de/buildr/buildr/generated/remote/(v[\w\d]+)
alias: $1$2
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: true # don't require an explanation for nolint directives
require-specific: true # 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 - enable later
- 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
fix: true
exclude-rules:
- path: _test\.go
linters:
- dupl
- funlen
- gocognit
- gomnd
- govet
- dupl
run:
build-tags:
- sudo
- integration
skip-dirs:
- modules/state/schema
skip-files:
- ".*\\.pb\\.go$"
- ".*.mock.\\.go$"
modules-download-mode: readonly
go: "1.19"
timeout: 10m
service:
golangci-lint-version: 1.53.x # use the fixed version to not introduce new linters unexpectedly