-
Notifications
You must be signed in to change notification settings - Fork 3
/
.golangci.yml
71 lines (64 loc) · 2.63 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
run:
go: "1.23"
timeout: 5m
linters:
enable-all: true
disable:
# Base linters disabled for all projects.
- funlen
- mnd # Same as above
- exhaustruct # This linter is meant to be used only for special cases. It is not recommended to use it for all files in a project.
- gci # Conflicts with gofumpt.
- 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.
- exportloopref
# We use maintidx to lint function complexity.
- gocyclo
- cyclop
- gocognit
# Project specific disable.
- lll
- varnamelen # I think there is too many false-positive.
- godox # too many TODO in code, but should be removed and TODO fixed :)
- nestif # Too many error for now, which would require significant refactor.
- tagliatelle # Check struct tags. Too many errors we can't fix.
- wrapcheck # Too many errors, which would require to refactor most returned errors.
- errorlint # Should be enabled, but it's difficult to test that we keep the same behavior with errors.As.
- contextcheck # Requires to change a lot of code to pass a context everywhere.
- gomoddirectives # We sometimes need to use mod replacements to fix upgrades.
- musttag # json tags must be added public fields used in JSON. Disabled because it also report errors on dependencies.
# Requires to review all our tests. Should be done.
- paralleltest
- tparallel
- 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"
issues:
include: # the list of ids of default excludes to include
- EXC0005 # ineffective break statement
- EXC0009 # create files/directories with minimum permissions
# - EXC0011 # TODO: should have a package comment|comment should be of the form
# - EXC0012 # TODO: 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
exclude-dirs:
- work