-
Notifications
You must be signed in to change notification settings - Fork 386
Expand file tree
/
Copy path.golangci.yaml
More file actions
136 lines (136 loc) · 3.7 KB
/
.golangci.yaml
File metadata and controls
136 lines (136 loc) · 3.7 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
---
version: "2"
run:
allow-parallel-runners: true
build-tags:
- "ci" # enables runtime debug assertions (swaps assert_off.go for assert_on.go); not a test category
- "datastore" # datastore tests that run against real databases (crdb, postgres, spanner, mysql); needs Docker
- "datastoreconsistency" # cross-datastore consistency tests; needs Docker
- "image" # tests that run against the built SpiceDB Docker image; needs the image to be built
- "integration" # integration tests; explicit opt-in so they don't run during unit tests
- "mage" # marks files as belonging to the mage build system (magefiles/)
- "memoryprotection" # feature flag: swaps no-op for go-rtml memory usage provider (needs -ldflags=-checklinkname=0)
- "steelthread" # steel thread / golden-file tests against a real SpiceDB instance
- "pgbouncer" # pgbouncer-specific postgres datastore tests (subset of datastore)
- "postgres" # postgres-specific datastore tests (subset of datastore, excludes pgbouncer)
# - wasm
linters:
enable:
- "bidichk"
- "bodyclose"
- "depguard"
- "errcheck"
- "errname"
- "errorlint"
- "gocritic"
- "goprintffuncname"
- "gosec"
- "govet"
- "importas"
- "ineffassign"
- "makezero"
- "perfsprint"
- "prealloc"
- "predeclared"
- "promlinter"
- "revive"
- "rowserrcheck"
- "spancheck"
- "staticcheck"
- "tagalign"
- "testifylint"
- "unparam"
- "unconvert"
- "usetesting"
- "wastedassign"
- "whitespace"
- "unused"
settings:
depguard:
rules:
main:
deny:
- pkg: "k8s.io/utils/strings/slices$"
desc: "use github.com/samber/lo"
- pkg: "gopkg.in/yaml.v2"
desc: "use go.yaml.in/yaml/v3"
- pkg: "gopkg.in/yaml.v3"
desc: "use go.yaml.in/yaml/v3"
staticcheck:
checks:
- "all"
revive:
rules:
- name: "unused-parameter"
disabled: true
rowserrcheck:
packages:
- "github.com/jackc/pgx/v5"
exclusions:
generated: "lax"
presets:
- "comments"
- "common-false-positives"
- "legacy"
- "std-error-handling"
rules:
- linters:
- "errcheck"
text: "tx.Rollback()"
- linters:
- "staticcheck"
path: "internal/services/"
text: "SA1019"
- linters:
- "staticcheck"
path: "internal/middleware/consistency/"
text: "SA1019"
- linters:
- "staticcheck"
path: "pkg/proto/core/v1/core.pb.validate.manual.go"
text: "ST1003"
- linters:
- "revive"
path: "pkg/proto/core/v1/core.pb.validate.manual.go"
text: "var-naming"
- linters:
- "revive"
text: 'receiver-naming: receiver name \S+ should be consistent with previous receiver name \S+ for invalid-type'
- linters:
- "perfsprint"
path: '(.+)_test\.go'
- linters:
- "unparam"
text: "result .* is always|result .* is never used|always receives"
paths:
- "third_party$"
- "builtin$"
- "examples$"
formatters:
enable:
- "gci"
- "gofmt"
- "gofumpt"
- "goimports"
settings:
gofmt:
rewrite-rules:
- pattern: "interface{}"
replacement: "any"
- pattern: "a[b:len(a)]"
replacement: "a[b:]"
gci:
sections:
- "standard"
- "default"
- "prefix(github.com/authzed)"
- "localmodule"
goimports:
local-prefixes:
- "github.com/authzed/spicedb"
exclusions:
generated: "lax"
paths:
- "third_party$"
- "builtin$"
- "examples$"