-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy path.golangci.yaml
More file actions
155 lines (140 loc) · 4.66 KB
/
Copy path.golangci.yaml
File metadata and controls
155 lines (140 loc) · 4.66 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
version: "2"
run:
timeout: "5m"
relative-path-mode: "gomod"
formatters:
enable:
- "gofumpt"
- "goimports"
settings:
gofumpt:
extra:
# Groups function parameters with repeated types.
# Default: false
group-params: true
# Clothes naked returns in functions with named results.
# Default: false
clothe-returns: true
goimports:
# A list of prefixes, which, if set, checks import paths
# with the given prefixes are grouped after 3rd-party packages.
# Default: []
local-prefixes:
- "github.com/dsh2dsh/zrepl"
linters:
enable:
- "asciicheck"
- "bidichk"
- "copyloopvar"
- "embeddedstructfieldcheck"
- "errorlint"
- "gocritic"
- "makezero"
- "misspell"
- "modernize"
- "nilnesserr"
- "nolintlint"
- "paralleltest"
- "perfsprint"
- "prealloc"
- "predeclared"
- "sloglint"
- "testifylint"
- "unconvert"
- "usestdlibvars"
- "usetesting"
- "wastedassign"
- "wrapcheck"
settings:
errcheck:
exclude-functions:
# List of functions to exclude from checking, where each entry is a
# single function to exclude. See
# https://github.com/kisielk/errcheck#excluding-functions for details.
- "fmt.Fprint"
- "io/ioutil.ReadFile"
- "io.Copy(*bytes.Buffer)"
- "io.Copy(os.Stdout)"
- "(io.Closer).Close"
- "(net.Conn).Close"
- "(*os.File).Close"
- "(*github.com/fatih/color.Color).Fprintf"
- "(*github.com/fatih/color.Color).Printf"
# Display function signature instead of selector.
# Default: false
verbose: true
nolintlint:
# Enable to require an explanation of nonzero length after each nolint
# directive.
# Default: false
require-explanation: true
# Enable to require nolint directives to mention the specific linter being
# suppressed.
# Default: false
require-specific: true
paralleltest:
# Ignore missing calls to `t.Parallel()` and only report incorrect uses of it.
# Default: false
ignore-missing: true
# Ignore missing calls to `t.Parallel()` in subtests.
# Top-level tests are still required to have `t.Parallel`,
# but subtests are allowed to skip it.
# Default: false
ignore-missing-subtests: true
# Check that `defer` is not used with `t.Parallel`.
# (use `t.Cleanup` instead to ensure cleanup runs after parallel subtests complete).
# Default: false
check-cleanup: true
sloglint:
# Enforce using attributes only (overrides no-mixed-args, incompatible with kv-only).
# https://github.com/go-simpler/sloglint?tab=readme-ov-file#attributes-only
# Default: false
attr-only: true
staticcheck:
# https://staticcheck.dev/docs/configuration/options/#dot_import_whitelist
# Default: ["github.com/mmcloughlin/avo/build", "github.com/mmcloughlin/avo/operand", "github.com/mmcloughlin/avo/reg"]
dot-import-whitelist:
- "github.com/dsh2dsh/zrepl/internal/replication/logic/diff"
- "github.com/dsh2dsh/zrepl/internal/replication/logic/pdu"
# SAxxxx checks in https://staticcheck.dev/docs/configuration/options/#checks
# Example (to disable some checks): [ "all", "-SA1000", "-SA1001"]
# Default: ["all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022"]
checks:
- "all"
- "-ST1000"
- "-ST1003"
# ST1005 - Incorrectly formatted error string
# https://staticcheck.dev/docs/checks/#ST1005
- "-ST1005"
# Poorly chosen receiver name
# https://staticcheck.dev/docs/checks/#ST1006
- "-ST1006"
# ST1012 - Poorly chosen name for error variable
# https://staticcheck.dev/docs/checks/#ST1012
- "-ST1012"
- "-ST1016"
- "-ST1020"
- "-ST1021"
- "-ST1022"
usetesting:
# Enable/disable `os.Setenv()` detections.
# Default: false
os-setenv: true
# Enable/disable `os.TempDir()` detections.
# Default: false
os-temp-dir: true
wrapcheck:
# An array of glob patterns which, if any match the package of the function
# returning the error, will skip wrapcheck analysis for this error. This is
# useful for broadly ignoring packages and/or subpackages from wrapcheck
# analysis. There are no defaults for this value.
ignore-package-globs:
- "encoding/*"
- "github.com/dsh2dsh/zrepl/*"
exclusions:
rules:
- path: '_test\.go'
linters:
- "errcheck"
- "prealloc"
- "wrapcheck"