Repository navigation
Expand file tree
/
Copy path.golangci.yaml
More file actions
115 lines (103 loc) · 2.71 KB
/
Copy path.golangci.yaml
File metadata and controls
115 lines (103 loc) · 2.71 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
version: "2"
run:
# If set, we pass it to "go list -mod={option}". From "go help modules":
# If invoked with -mod=readonly, the go command is disallowed from the implicit
# automatic updating of go.mod described above. Instead, it fails when any changes
# to go.mod are needed. This setting is most useful to check that go.mod does
# not need updates, such as in a continuous integration and testing system.
# If invoked with -mod=vendor, the go command assumes that the vendor
# directory holds the correct copies of dependencies and ignores
# the dependency descriptions in go.mod.
#
# Allowed values: readonly|vendor|mod
# Default: ""
modules-download-mode: readonly
# Include test files or not.
# Default: true
tests: false
linters:
default: all
disable:
# Not useful
- depguard
# Banning TODO/FIXME outright removes useful context from the codebase
- godox
# Not terribly useful and ends up in too much boilerplate
- exhaustruct
# False positives in this codebase
- musttag
# Meh
- noinlineerr
# Deprecated
- wsl
# More false positive than actual issues
- mnd
# Cobra CLI pattern: init() for command registration, package-level command vars
- gochecknoglobals
- gochecknoinits
# Too pervasive, needs a dedicated pass
- err113
- wrapcheck
# Scanner constructors return Scanner by design
- ireturn
# TODO: fix and enable these
- cyclop
- gocognit
settings:
lll:
line-length: 120
wrapcheck:
ignore-sigs:
# No point in wrapping these
- func encoding/json.Marshal(v any)
- func encoding/json.UnmarshalJSON(v any)
# Defaults
- .Errorf(
- errors.New(
- errors.Unwrap(
- .Wrap(
- .Wrapf(
- .WithMessage(
- .WithMessagef(
- .WithStack(
funlen:
# Increase the number of lines, considering funlen counts comments as well
# (https://github.com/ultraware/funlen/issues/12)
#
# default: 60
lines: 80
usetesting:
context-background: true
context-todo: true
os-chdir: true
os-mkdir-temp: true
os-setenv: true
os-create-temp: true
os-temp-dir: false
forbidigo:
forbid:
- pattern: ^(fmt\.Print(|f|ln)|print|println)$
- pattern: ^os\.Exit$
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- gci
- gofmt
- gofumpt
- goimports
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$