-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yml
78 lines (69 loc) · 2.45 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
74
75
76
77
78
run:
go: "1.23"
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.
# Disable deprecated and replaced linter.
- execinquery
- exportloopref
# We use maintidx to lint function complexity.
- gocyclo
- cyclop
- gocognit
# Project specific disable.
- wrapcheck # too many errors. Partially done and should be completed
- err113 # Requires to refactor how we return error. But would be useful
# Requires to review all our tests. Should be done
- paralleltest
- tparallel
- testpackage
linters-settings:
nolintlint:
# Ensure that nolint directives don't have a leading space.
allow-leading-space: false
# 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"
# Project specific settings.
gomoddirectives:
# List of allowed `replace` directives. Needed because go.mod doesn't support nolint comments.
replace-allow-list:
- cloud.google.com/go
issues:
exclude-rules:
- path: _test\.go
linters:
- dupl
- gosec
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