-
Notifications
You must be signed in to change notification settings - Fork 3
/
.golangci.yml
72 lines (68 loc) · 1.92 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
run:
go: "1.23"
issues:
max-issues-per-linter: 0
max-same-issues: 0
output:
uniq-by-line: false
linters:
enable:
- forbidigo
- gofumpt
- goimports
# govulncheck is waiting on https://github.com/golangci/golangci-lint/pull/3199
# this is useful, but it is a MONSTROUS yak shave, don't have time for doing
# this 100% for now
# - wrapcheck
# unparam temporarily broken:
# https://github.com/golangci/golangci-lint/issues/3426
#- unparam
linters-settings:
forbidigo:
exclude-godoc-examples: true
forbid:
- "os.Exit"
- "cobra.CheckErr"
gofumpt:
extra-rules: true
goimports:
# keep in sync with magefile
local-prefixes: github.com/6RiverSystems,go.6river.tech
wrapcheck:
ignorePackageGlobs:
# context errors are generally just propagated and something else has the
# real error
- "context"
# errgroup.Wait returns something that should already be wrapped
- "golang.org/x/sync/errgroup"
ignoreInterfaceRegexps:
# context errors are generally just propagated and something else has the
# real error
- "context.Context"
ignoreSigs:
# need to repeat the defaults
- ".Errorf("
- "errors.New("
- "errors.Unwrap("
- ".Wrap("
- ".Wrapf("
- ".WithMessage("
- ".WithMessagef("
- ".WithStack("
# failures from this are huge bugs and not expected to happen IRL
- "net/http.NewRequestWithContext("
# these OS errors self annotate the file related to the failure, and so
# are thus generally already detailed enough
- "os.Stat("
- "os.RemoveAll("
- "os.MkdirAll("
- "os.Open("
- "os.OpenFile("
- "os.ReadDir("
# aggregate collapse
- ".ErrorOrNil()"
- "multierror.Append("
# these just return context.Context.Err()
- "channels.SendOrErr"
# self-annotates
- "config.GetConfig("