-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yml
73 lines (64 loc) · 2.28 KB
/
.golangci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
run:
go: "1.19"
timeout: 5m
linters:
enable-all: true
disable:
# Base linters disabled for all projects.
- funlen
- gomnd # Too picky. For example it says that 1000 (used in number of ms in one second) is a magic number.
- mnd # Same as above.
- exhaustruct # Same as above.
- gci # Conflicts with gofumpt.
- varnamelen # I think there is too many false-positive.
- ireturn # Complain that interface A implementation method return an interface B... it's a requirement of interface A that is unavoidable.
- nonamedreturns # Warn for every named return, not useful.
- interfacebloat # Warn when an interface has too many methods, not useful.
# Deprecated and replaced linter.
- execinquery
- exportloopref
# We use maintidx to lint function complexity.
- gocyclo
- cyclop
- gocognit
# Project specific disable.
- testpackage
linters-settings:
nolintlint:
# Require nolint directives to mention the specific linter being suppressed.
require-specific: true
tagliatelle:
# Check struct tag name case.
case:
# Use the struct field name to check the name of the struct tag.
rules:
json: snake
yaml: snake
depguard:
rules:
main:
deny:
- pkg: "io/ioutil"
desc: "ioutil is deprecated starting with Go 1.16"
errorlint:
errorf-multi: false # Prior to Go1.20, fmt.Errorf can only wrap a single error
forbidigo:
exclude-godoc-examples: true
issues:
exclude-dirs-use-default: false # Exclusion of the 'examples' dir may be the cause of ignoring all issues.
exclude-files:
- doc.go # Ain't no code in here
exclude-rules:
# False positive: https://github.com/kunwardeep/paralleltest/issues/8.
- linters:
- paralleltest
text: "does not use range value in test Run"
include: # the ids of default excluded to include
- EXC0005 # ineffective break statement
- EXC0009 # create files/directories with minimum permissions
- EXC0011 # should have a package comment|comment should be of the form
- EXC0012 # exported var/functions should have a comment
- EXC0013 # package comment should be of the form
- EXC0014 # comment on exported var should be of the form
max-issues-per-linter: 0
max-same-issues: 0