-
Notifications
You must be signed in to change notification settings - Fork 58
Expand file tree
/
Copy path.golangci.yaml
More file actions
131 lines (131 loc) · 3.07 KB
/
Copy path.golangci.yaml
File metadata and controls
131 lines (131 loc) · 3.07 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
version: "2"
linters:
default: all
disable:
# these linters are disabled either because they
# are annoying or because they are deprecated
- dupword
- err113
- exhaustruct
- exhaustive
- funlen
- gochecknoglobals
- gochecknoinits
- gocognit
- goconst
- gocyclo
- godox
- gomodguard # replace by gomodguard_v2
- inamedparam
- ireturn
- mnd
- nestif
- noinlineerr
- nonamedreturns
- promlinter # we don't use Prometheus
- protogetter # we don't have protobuf types
- rowserrcheck # we don't use SQL
- sqlclosecheck # we don't use SQL
- testifylint # not used here
- testpackage
- unqueryvet # no SQL here
- varnamelen
- wrapcheck
- wsl # replaced by wsl_v5
settings:
cyclop:
max-complexity: 40 # default is 10
depguard:
rules:
main:
deny:
- pkg: gopkg.in/yaml.v2
desc: use yaml.v3 only
errcheck:
exclude-functions:
- (*github.com/olekukonko/tablewriter.Table).Append
- (*github.com/olekukonko/tablewriter.Table).Render
gocritic:
enable-all: true
disabled-checks:
- importShadow
- initClause
- whyNoLint # not all nolint comments need explanations
- hugeParam # investigate later, but some of these breaks API signatures
- unnamedResult
gosec:
excludes:
# taint analysis. not relevant as Regal assumes trusted user
- G703
- G704
- G706
govet:
disable:
- shadow
- fieldalignment
enable-all: true
perfsprint:
err-error: true
revive:
rules:
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-parameter
- name: unused-parameter
arguments:
- allowRegex: ^_
severity: warning
disabled: false
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-receiver
- name: unused-receiver
arguments:
- allowRegex: ^_
severity: warning
disabled: false
staticcheck:
checks:
- all
tagliatelle:
case:
rules:
json: snake
unused:
exported-fields-are-used: false
usetesting:
context-background: true
context-todo: true
os-create-temp: true
os-temp-dir: true
exclusions:
rules:
- path: '(.+)_test\.go'
linters:
- forcetypeassert
- godot
- gosec
- path: internal/lsp
linters:
- tagliatelle
- path: pkg/config
linters:
- tagliatelle
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
warn-unused: true
formatters:
enable:
- gci
- gofmt
- gofumpt
- goimports
settings:
gci:
sections:
- standard
- default
- prefix(github.com/open-policy-agent/opa)
- prefix(github.com/open-policy-agent/regal)
- blank
- dot