]> git.giacomolli.uk - onechat/blob - .golangci.yml
Derive contexts from the caller and name timeouts
[onechat] / .golangci.yml
1 version: "2"
2
3 linters:
4 default: standard
5 enable:
6 - errorlint
7 - gocritic
8 - testifylint
9 - revive
10 - wrapcheck
11 - nlreturn
12 - wsl_v5
13 settings:
14 wsl_v5:
15 # go-code: Keep an operation with its immediate error check.
16 enable:
17 - err
18 - after-block
19 - after-decl
20 - after-defer
21 - after-expr
22 - after-go
23 # go-code: Keep a short declaration with its immediate use.
24 allow-first-in-block: true
25 allow-whole-block: true
26 cuddle-max-statements: 2
27 disable:
28 # go-code: Keep a short declaration with its immediate assignment use.
29 - assign
30 # go-code: Keep a short declaration, its operation, and its error check
31 # together.
32 - if
33 # go-code: A short declaration can feed the next loop setup.
34 - for
35 # go-code: A short declaration can feed the next switch setup.
36 - switch
37 # go-code: Keep a declared cleanup with its immediate defer.
38 - defer
39 # go-code: Keep a short declaration with its immediate append use.
40 - append
41 # go-code: Keep a short declaration with its immediate worker setup.
42 - go
43 nlreturn:
44 # go-code: Keep a short declaration with its immediate use.
45 block-size: 2
46 wrapcheck:
47 # go-code: Return ctx.Err() directly.
48 extra-ignore-sigs:
49 - "(context.Context).Err() error"
50 exclusions:
51 rules:
52 # go-code: A function with one error path can return it directly.
53 - linters: [wrapcheck]
54 path: ^records\.go$
55 source: 'return r\.file\.Close\(\)'
56 - linters: [wrapcheck]
57 path: ^log_test\.go$
58 source: 'return os\.Truncate\('
59 - linters: [wrapcheck]
60 path: ^sync_buffer_helper_test\.go$
61 source: 'return b\.buffer\.Write\('
62 - linters: [wrapcheck]
63 path: ^probe\.go$
64 source: 'return s\.inner\.Summarize\('
65 - linters: [wrapcheck]
66 path: ^view\.go$
67 source: 'return false, err'
68 - linters: [wrapcheck]
69 path: ^whatsapp\.go$
70 text: 'sqlstore\.Container\)\.Close\('