Debian Codegraph @

.golangci.yml

raw symbols SCIP
1 version: "2"
2 linters:
3 enable:
4 - asasalint
5 - asciicheck
6 - bidichk
7 - bodyclose
8 - canonicalheader
9 # - containedctx - there are enough legitimate cases
10 - contextcheck
11 - copyloopvar
12 # - cyclop - too opinionated on code structure
13 - decorder
14 # - depguard - must be explicitly configured
15 # - dogsled - some APIs just lend to it
16 # - dupl - duplicate code can be useful many times
17 - dupword
18 - durationcheck
19 # - err113 - good for avoiding errors.New but prevents fmt.Errorf which seems too strict
20 - errchkjson
21 - errname
22 - errorlint
23 - exhaustive
24 # - exhaustruct - tedious for non-controlled structs
25 - exptostd
26 - fatcontext
27 # - forbidigo - must be explicitly configured
28 - forcetypeassert
29 # - funcorder - TODO to consider this as it can be good, but huge blast radious
30 # - funlen - long functions can be clearer many times
31 # - ginkgolinter - don't use ginkgo
32 - gocheckcompilerdirectives
33 # - gochecknoglobals - globals are useful many times
34 # - gochecknoinits - inits are useful many times
35 - gochecksumtype
36 # - gocognit - too opinionated on code structure
37 # - goconst - repeated strings can be more readable
38 - gocritic
39 # - gocyclo - too opinionated on code structure
40 - godot
41 # - godox - sometimes we leave TODOs
42 # - goheader - must be explicitly configured
43 # - gomoddirectives - must be explicitly configured
44 # - gomodguard - must be explicitly configured
45 - goprintffuncname
46 - gosec
47 # - gosmopolitan - sometimes want to use Japanese text
48 # - grouper - requiring group for single item conflicts with gofumpt
49 - iface
50 # - importas - must be explicitly configured
51 - inamedparam
52 # - interfacebloat - no standard rule
53 - intrange
54 # - ireturn - not always valid
55 # - lll - too opinionated on code structure
56 - loggercheck
57 # - maintidx - too opinionated on code structure
58 - makezero
59 - mirror
60 # - mnd - can be more readable
61 - musttag
62 - nakedret
63 # - nestif - too opinionated on code structure
64 - nilerr
65 - nilnesserr
66 - nilnil
67 # nlreturn - too opinionated on style
68 - noctx
69 # - nolintlint - seems to just remove nolint directives
70 # nonamedreturns - too opinionated on style
71 - nosprintfhostport
72 # - paralleltest - not always possible
73 - perfsprint
74 - prealloc
75 # - predeclared - can be too tedious
76 # - promlinter - don't use prometheus
77 - protogetter
78 - reassign
79 - recvcheck
80 - revive
81 - rowserrcheck
82 - sloglint
83 - spancheck
84 - sqlclosecheck
85 - tagalign
86 - testifylint
87 # - testpackage - don't need it usually
88 - thelper
89 - tparallel
90 - unconvert
91 - usestdlibvars
92 - usetesting
93 # - varnamelen - too opinionated on style
94 - wastedassign
95 - whitespace
96 - wrapcheck
97 # - wsl - too opinionated on style
98 - zerologlint
99 settings:
100 gosec:
101 excludes:
102 # Use unsafe frequently for cgo performance and should be fine
103 - G103
104 # Due to 32-bit nature of wasm, it's very common to convert to 32-bit here
105 # and not worth too much checking.
106 - G115
107 grouper:
108 const-require-grouping: true
109 import-require-grouping: true
110 var-require-grouping: true
111 revive:
112 # Defaults from https://github.com/mgechev/revive/blob/master/defaults.toml
113 # Because we want to set preserveScope in one setting, we end up having to
114 # list them all out.
115 rules:
116 - name: blank-imports
117 - name: context-as-argument
118 - name: context-keys-type
119 - name: dot-imports
120 - name: empty-block
121 - name: error-naming
122 - name: error-return
123 - name: error-strings
124 - name: errorf
125 - name: exported
126 disabled: true
127 - name: increment-decrement
128 - name: indent-error-flow
129 arguments:
130 - preserve-scope
131 - name: package-comments
132 disabled: true
133 - name: range
134 - name: receiver-naming
135 - name: redefines-builtin-id
136 # TODO: Investigate why preserve-scope doesn't work
137 - name: superfluous-else
138 disabled: true
139 arguments:
140 - preserve-scope
141 - name: time-naming
142 - name: unexported-return
143 - name: unreachable-code
144 - name: unused-parameter
145 - name: var-declaration
146 - name: var-naming
147 exclusions:
148 presets:
149 - comments
150 rules:
151 - linters:
152 - errcheck
153 - errchkjson
154 - gosec
155 - noctx
156 path: _test\.go
157 paths:
158 # Preserve code copied from upstream
159 - all_test.go
160 - benchmarks_test.go
161 - exec_test.go
162 - find_test.go
163 formatters:
164 enable:
165 - gci
166 - gofumpt
167 settings:
168 gci:
169 sections:
170 - standard
171 - default
172 - prefix(github.com/wasilibs/go-re2)