-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy path.golangci.yml
More file actions
190 lines (188 loc) · 5.18 KB
/
Copy path.golangci.yml
File metadata and controls
190 lines (188 loc) · 5.18 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
version: "2"
linters:
# Default set of linters.
# The value can be:
# - `standard`: https://golangci-lint.run/docs/linters/#enabled-by-default
# - `all`: enables all linters by default.
# - `none`: disables all linters by default.
# - `fast`: enables only linters considered as "fast" (`golangci-lint help linters --json | jq '[ .[] | select(.fast==true) ] | map(.name)'`).
# Default: standard
default: none
enable:
- asciicheck
- bidichk
- bodyclose
- containedctx
# - contextcheck
- copyloopvar
# - cyclop
- decorder
- depguard
- dogsled
- dupl
- durationcheck
- embeddedstructfieldcheck
- errcheck
- errchkjson
- errname
- errorlint
- exhaustive
- exptostd
- fatcontext
- forbidigo
- forcetypeassert
- funcorder
- ginkgolinter
- gochecksumtype
- goconst
- gocritic
- godoclint
- godot
- godox
- gosec
- gosmopolitan
- govet
- grouper
- iface
- importas
- inamedparam
- ineffassign
- interfacebloat
- intrange
- iotamixing
- loggercheck
- makezero
- mirror
- misspell
- mnd
- musttag
- nakedret
- nestif
- nilerr
- nilnesserr
- nilnil
- nlreturn
- noctx
- nolintlint
- nonamedreturns
- nosprintfhostport
- paralleltest
- perfsprint
- prealloc
- predeclared
- reassign
- recvcheck
- rowserrcheck
- sqlclosecheck
- staticcheck
- tagalign
- tagliatelle
- tparallel
- unconvert
- unparam
- unused
- usestdlibvars
- wastedassign
- whitespace
- exhaustruct
exclusions:
rules:
# Partially initialized fixture structs and repeated fixture literals
# are the point of table tests.
- path: _test\.go
linters:
- exhaustruct
- goconst
settings:
mnd:
# The int argument of these is an indent level / newline count.
ignored-functions:
- '^.*NNewLine$'
- '^.*WriteIndentedLine$'
- '^.*WriteIndentedString$'
exhaustruct:
# List of regular expressions to match type names that should be excluded from processing.
# Anonymous structs can be matched by '<anonymous>' alias.
# Has precedence over `include`.
# Each regular expression must match the full type name, including package path.
# For example, to match type `net/http.Cookie` regular expression should be `.*/http\.Cookie`,
# but not `http\.Cookie`.
# Default: []
exclude:
# Internal IR types: literals name only meaningful fields instead of
# restating every zero value at each construction site.
- '.*/internal/model\.PyType$'
- '.*/internal/model\.QueryValue$'
- '.*/internal/model\.Column$'
- '.*/internal/render\.importSpec$'
- '.*/plugin\.Identifier$'
allow-empty: true
tagliatelle:
case:
rules:
json: snake
yaml: snake
nonamedreturns:
report-error-in-defer: true
errcheck:
check-type-assertions: true
check-blank: true
disable-default-exclusions: true
# These are documented to always return a nil error.
exclude-functions:
- '(*strings.Builder).WriteString'
- '(*strings.Builder).WriteRune'
- '(*strings.Builder).WriteByte'
exhaustive:
default-signifies-exhaustive: true
depguard:
# Rules to apply.
#
# Variables:
# - File Variables
# Use an exclamation mark `!` to negate a variable.
# Example: `!$test` matches any file that is not a go test file.
#
# `$all` - matches all go files
# `$test` - matches all go test files
#
# - Package Variables
#
# `$gostd` - matches all of go's standard library (Pulled from `GOROOT`)
#
# Default (applies if no custom rules are defined): Only allow $gostd in all files.
rules:
main:
list-mode: strict
# List of file globs that will match this list of settings to compare against.
# By default, if a path is relative, it is relative to the directory where the golangci-lint command is executed.
# The placeholder '${base-path}' is substituted with a path relative to the mode defined with `run.relative-path-mode`.
# The placeholder '${config-path}' is substituted with a path relative to the configuration file.
# Default: $all
files:
- "$all"
- "!$test"
# List of allowed packages.
# Entries can be a variable (starting with $), a string prefix, or an exact match (if ending with $).
# Default: []
allow:
- "$gostd"
- "github.com/sqlc-dev/plugin-sdk-go"
- "github.com/jinzhu/inflection"
- "github.com/rayakame/sqlc-gen-better-python"
- "golang.org/x/text/cases"
- "golang.org/x/text/language"
formatters:
# Enable specific formatter.
# Default: [] (uses standard Go formatting)
enable:
- gci
- swaggo
- gofmt
- gofumpt
- goimports
- golines
settings:
golines:
max-len: 130
chain-split-dots: false