forked from riverqueue/riverui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yaml
98 lines (84 loc) · 2.61 KB
/
.golangci.yaml
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
issues:
exclude:
- 'Error return value of .(\w+\.Rollback(.*)). is not checked'
linters:
presets:
- bugs
- comment
- format
- performance
- style
- test
- unused
disable:
- intrange # encourages for loops to range over integers like `for i := range(5)` instead of a C-style for
# disabled, but which we should enable with discussion
- wrapcheck # checks that errors are wrapped; currently not done anywhere
# disabled because we're not compliant, but which we should think about
- exhaustruct # checks that properties in structs are exhaustively defined; may be a good idea
- testpackage # requires tests in test packages like `river_test`
# disabled because they're annoying/bad
- err113 # wants all errors to be defined as variables at the package level; quite obnoxious
- interfacebloat # we do in fact want >10 methods on the Adapter interface or wherever we see fit.
- godox # bans TODO statements; total non-starter at the moment
- ireturn # bans returning interfaces; questionable as is, but also buggy as hell; very, very annoying
- lll # restricts maximum line length; annoying
- mnd # detects "magic numbers", which it defines as any number; annoying
- nlreturn # requires a blank line before returns; annoying
- wsl # a bunch of style/whitespace stuff; annoying
linters-settings:
depguard:
rules:
all:
files: ["$all"]
allow:
deny:
- desc: "Use `github.com/google/uuid` package for UUIDs instead."
pkg: "github.com/xtgo/uuid"
exhaustive:
default-signifies-exhaustive: true
forbidigo:
forbid:
- msg: "Use `require` variants instead."
p: '^assert\.'
- msg: "Use `Func` suffix for function variables instead."
p: 'Fn\b'
- msg: "Use built-in `max` function instead."
p: '\bmath\.Max\b'
- msg: "Use built-in `min` function instead."
p: '\bmath\.Min\b'
gci:
sections:
- Standard
- Default
- Prefix(github.com/riverqueue)
- Prefix(riverqueue.com/riverui)
gomoddirectives:
replace-local: true
revive:
rules:
tagliatelle:
case:
rules:
json: snake
testifylint:
enable-all: true
disable:
- go-require
varnamelen:
ignore-names:
- db
- eg
- f
- i
- id
- j
- mu
- r # common for http.Request
- rw # common for http.ResponseWriter
- sb # common convention for string builder
- t
- tt # common convention for table tests
- tx
- w # common for http.ResponseWriter
- wg