-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy path.golangci.yaml
More file actions
115 lines (115 loc) · 2.94 KB
/
Copy path.golangci.yaml
File metadata and controls
115 lines (115 loc) · 2.94 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:
timeout: 5m
linters:
default: none
enable:
- copyloopvar
- errcheck
- gocritic
- govet
- ineffassign
- intrange
- mirror
- misspell
- perfsprint
- prealloc
- revive # replacement for golint
- staticcheck
- unconvert
- unused
- usetesting
# - gosec # too many false positives
settings:
gocritic:
enabled-checks:
# NOTE that these are rules enabled in addition to the default set
- filepathJoin
- dupImport
- redundantSprint
- stringConcatSimplify
disabled-checks:
- appendAssign
# NOTE(ae): this one should be enabled, but there were too
# many violations to fix in one go... revisit later
- singleCaseSwitch
# Reasonable rule, but not sure what to replace with in
# many locations, so disabling for now
- exitAfterDefer
# This is disabled from the perfomance tag enabled further down.
- hugeParam
enabled-tags:
- performance
settings:
ifElseChain:
# ridiculous value set for now, but this should be
# lowered to something more reasonable, as the rule
# is reasonable (replace long if-else chains with
# switch)... just too many violations right now
minThreshold: 10
govet:
disable:
# enable later and fix
- buildtag
enable:
- deepequalerrors
- nilness
lll:
line-length: 200
perfsprint:
# only rule disabled by default, but it's a good one
err-error: true
revive:
# this mainly complains about us using min/max for variable names,
# which seems like an unlikely source of actual issues
rules:
- name: redefines-builtin-id
disabled: true
- name: unused-receiver
disabled: false
staticcheck:
checks:
# https://staticcheck.dev/docs/checks/#<check-id> for more details on these rules
[
"all",
"-ST1000",
"-ST1003",
"-ST1016",
"-ST1020",
"-ST1021",
"-ST1022",
"-QF1001",
"-QF1002",
"-QF1003",
"-QF1008",
]
exclusions:
warn-unused: true
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- staticcheck
text: This package is intended for older projects transitioning from OPA v0.x
path-except: v1/
- linters:
- staticcheck
text: SA1019 # Using a deprecated function, variable, constant or field
path: _test\.go
paths:
- internal/gojsonschema
- internal/methodlesstemplate
- node_modules
issues:
# don't hide issues in CI runs because they are the same type
max-same-issues: 0
formatters:
enable:
- gofmt
- goimports
exclusions:
generated: lax