forked from alecthomas/arena
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yml
148 lines (145 loc) · 4.12 KB
/
.golangci.yml
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
run:
tests: true
timeout: 5m
output:
print-issued-lines: false
linters:
enable-all: true
disable:
- mnd # So annoying
- execinquery
- lll
- typecheck # `go build` catches this, and it doesn't currently work with Go 1.11 modules
- goimports # horrendously slow with go modules :(
- dupl # has never been actually useful
- gochecknoglobals
- gochecknoinits
- funlen
- whitespace
- godox
- wsl
- dogsled
- gomnd
- gocognit
- gocyclo
- godot
- nestif
- testpackage
- gci
- gofumpt
- nlreturn
- forbidigo
- cyclop
- paralleltest
- tagliatelle
- gomoddirectives
- err113
- varnamelen
- ireturn
- containedctx
- nilnil
- contextcheck
- nonamedreturns
- exhaustruct
- nosprintfhostport
- nilerr
- goconst
- prealloc
- rowserrcheck # doesn't support generics
- wastedassign # doesn't support generics
- goprintffuncname
- dupword
- errchkjson
- musttag
- gofmt # autofmt
- interfacebloat
- tagalign
- nolintlint
- protogetter
- thelper
- perfsprint
- exportloopref
- predeclared
linters-settings:
exhaustive:
default-signifies-exhaustive: true
govet:
enable:
- "shadow"
dupl:
threshold: 100
goconst:
min-len: 8
min-occurrences: 3
gocyclo:
min-complexity: 20
gocritic:
disabled-checks:
- ifElseChain
errcheck:
check-blank: true
depguard:
rules:
main:
deny:
- pkg: github.com/pkg/errors
desc: "use fmt.Errorf or errors.New"
- pkg: github.com/stretchr/testify
desc: "use github.com/alecthomas/assert/v2"
- pkg: github.com/alecthomas/errors
desc: "use fmt.Errorf or errors.New"
- pkg: braces.dev/errtrace
desc: "use fmt.Errorf or errors.New"
- pkg: os/exec
desc: "use github.com/TBD54566975/ftl/internal/exec"
- pkg: golang.design/x/reflect
desc: "use github.com/TBD54566975/ftl/internal/reflect"
- pkg: "github.com/reugn/go-quartz/logger"
desc: "use github.com/TBD54566975/ftl/internal/log"
# wrapcheck:
# ignorePackageGlobs:
# - github.com/TBD54566975/ftl/*
spancheck:
extra-start-span-signatures:
- "github.com/TBD54566975/ftl/backend/controller/observability.BeginSpan:opentelemetry"
issues:
max-same-issues: 0
max-issues-per-linter: 0
exclude-dirs:
- resources
- old
exclude-files:
- cmd/protopkg/main.go
exclude-use-default: false
exclude:
# Captured by errcheck.
- "^(G104|G204):"
# Very commonly not checked.
- 'Error return value of .(.*\.Help|.*\.MarkFlagRequired|(os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*Print(f|ln|)|os\.(Un)?Setenv). is not checked'
# Weird error only seen on Kochiku...
- "internal error: no range for"
- 'exported method `.*\.(MarshalJSON|UnmarshalJSON|URN|Payload|GoString|Close|Provides|Requires|ExcludeFromHash|MarshalText|UnmarshalText|Description|Check|Poll|Severity)` should have comment or be unexported'
- "composite literal uses unkeyed fields"
- 'declaration of "err" shadows declaration'
- "by other packages, and that stutters"
- "Potential file inclusion via variable"
- "at least one file in a package should have a package comment"
- "bad syntax for struct tag pair"
- "should have comment or be unexported"
- "package-comments"
- "parameter testing.TB should have name tb"
- "blank-imports"
- 'should have comment \(or a comment on this block\) or be unexported'
- caseOrder
- unused-parameter
- "^loopclosure:"
- 'shadow: declaration of "ctx" shadows declaration at'
- 'shadow: declaration of "ok" shadows declaration'
- "^dot-imports:"
- "fmt.Errorf can be replaced with errors.New"
- "fmt.Sprintf can be replaced with string concatenation"
- "strings.Title has been deprecated"
- "error returned from external package is unwrapped.*TranslatePGError"
- "struct literal uses unkeyed fields"
- "exported: comment on exported type"
- G103