Linter configuration and linting.
This commit is contained in:
93
.golangci.yml
Normal file
93
.golangci.yml
Normal file
@@ -0,0 +1,93 @@
|
||||
---
|
||||
version: "2"
|
||||
|
||||
linters:
|
||||
default: all
|
||||
disable:
|
||||
- containedctx
|
||||
- depguard
|
||||
- exhaustruct
|
||||
- gochecknoglobals
|
||||
- interfacebloat
|
||||
- ireturn
|
||||
- mnd
|
||||
- testpackage
|
||||
- tparallel
|
||||
- unused
|
||||
- varnamelen
|
||||
- noinlineerr
|
||||
- wsl
|
||||
settings:
|
||||
cyclop:
|
||||
max-complexity: 30
|
||||
package-average: 30
|
||||
forbidigo:
|
||||
forbid:
|
||||
- pattern: ^(fmt\.Print(|f|ln)|print|println)$
|
||||
- pattern: ^time\.Now\(\)($|\.F|\.A|\.B|\.L|\.UTC\(\)\.I|,|\))(# Calls of time\.Now() without \.UTC() is prohibited\.)?
|
||||
funlen:
|
||||
lines: 200
|
||||
statements: 60
|
||||
ignore-comments: true
|
||||
gocyclo:
|
||||
min-complexity: 20
|
||||
govet:
|
||||
enable-all: true
|
||||
funcorder:
|
||||
constructor: true
|
||||
struct-method: false
|
||||
alphabetical: true
|
||||
lll:
|
||||
line-length: 120
|
||||
nestif:
|
||||
min-complexity: 20
|
||||
tagliatelle:
|
||||
case:
|
||||
rules:
|
||||
json: snake
|
||||
yaml: camel
|
||||
use-field-name: true
|
||||
wsl_v5:
|
||||
allow-first-in-block: true
|
||||
allow-whole-block: false
|
||||
branch-max-lines: 2
|
||||
exclusions:
|
||||
generated: lax
|
||||
rules:
|
||||
- linters:
|
||||
- gosec
|
||||
path: .+_test\.go
|
||||
- linters:
|
||||
- godox
|
||||
text: TODO
|
||||
- linters:
|
||||
- govet
|
||||
text: declaration of "err" shadows
|
||||
- path: (.+)\.go$
|
||||
text: ST1000
|
||||
- path: (.+)\.go$
|
||||
text: package-comments
|
||||
- linters:
|
||||
- cyclop
|
||||
path: (.+)_test\.go
|
||||
paths:
|
||||
- third_party$
|
||||
- builtin$
|
||||
- examples$
|
||||
issues:
|
||||
max-issues-per-linter: 0
|
||||
max-same-issues: 0
|
||||
formatters:
|
||||
enable:
|
||||
- gofmt
|
||||
- gofumpt
|
||||
settings:
|
||||
gofumpt:
|
||||
module-path: "bunker"
|
||||
extra-rules: true
|
||||
exclusions:
|
||||
generated: lax
|
||||
paths:
|
||||
- third_party$
|
||||
- builtin$
|
||||
- examples$
|
Reference in New Issue
Block a user