]> git.giacomolli.uk - onechat/blob - .golangci.yml
Separate returns from longer statement blocks
[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 settings:
13 nlreturn:
14 # go-code: Keep a short declaration with its immediate use.
15 block-size: 2
16 wrapcheck:
17 # go-code: Return ctx.Err() directly.
18 extra-ignore-sigs:
19 - "(context.Context).Err() error"
20 exclusions:
21 rules:
22 # go-code: A function with one error path can return it directly.
23 - linters: [wrapcheck]
24 path: ^records\.go$
25 source: 'return r\.file\.Close\(\)'
26 - linters: [wrapcheck]
27 path: ^log_test\.go$
28 source: 'return os\.Truncate\('
29 - linters: [wrapcheck]
30 path: ^sync_buffer_helper_test\.go$
31 source: 'return b\.buffer\.Write\('
32 - linters: [wrapcheck]
33 path: ^probe\.go$
34 source: 'return s\.inner\.Summarize\('
35 - linters: [wrapcheck]
36 path: ^view\.go$
37 source: 'return false, err'
38 - linters: [wrapcheck]
39 path: ^whatsapp\.go$
40 text: 'sqlstore\.Container\)\.Close\('