-
Notifications
You must be signed in to change notification settings - Fork 213
/
.golangci.yml
88 lines (87 loc) · 1.96 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
79
80
81
82
83
84
85
86
87
88
run:
go: "1.20"
linters:
disable-all: true
enable:
- dupl
- errorlint
- errcheck
- gofmt
- goimports
- gosimple
- govet
- importas
- ineffassign
- misspell
- nilerr
- reassign
- revive
- staticcheck
- stylecheck
- tenv
- typecheck
- unconvert
- unparam
- unused
- usestdlibvars
- varnamelen
# - wrapcheck If we're going to use github.com/pkg/errors we should probably turn this on?
# We'd like to have the following linter enabled, but it's broken for Go
# 1.19 as of golangci-lint v1.48.0. Re-enable it when this issue is
# fixed: https://github.com/golangci/golangci-lint/issues/2649
# - structcheck
linters-settings:
errorlint:
errorf: false
revive:
rules: # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md
- name: atomic
- name: bare-return
- name: bool-literal-in-expr
- name: cognitive-complexity
arguments:
- 30 # TODO: gradually reduce it
- name: datarace
- name: duplicated-imports
- name: early-return
- name: error-return
- name: error-strings
- name: if-return
- name: indent-error-flow
- name: range-val-address
- name: receiver-naming
- name: time-naming
- name: var-naming
- name: unreachable-code
varnamelen:
max-distance: 10
ignore-decls:
- a []any
- c echo.Context
- const C
- e error
- e watch.Event
- f *foo.Bar
- f fmt.State
- i int
- id string
- m map[string]any
- m map[string]int
- n int
- ns string
- r *http.Request
- r io.Reader
- r *os.File
- re *regexp.Regexp
- sh *Shell
- sh *shell
- sh *shell.Shell
- sh shell
- T any
- t testing.T
- w http.ResponseWriter
- w io.Writer
- w *os.File
wrapcheck:
ignorePackageGlobs:
- go.jetpack.io/devbox/*