|
1 | | -output: |
2 | | - sort-results: true |
3 | | - |
| 1 | +version: "2" |
4 | 2 | linters: |
5 | 3 | enable: |
6 | 4 | - depguard |
7 | 5 | - errorlint |
8 | 6 | - godot |
9 | | - - gofumpt |
10 | | - - goimports |
11 | 7 | - misspell |
12 | 8 | - revive |
13 | | - - testifylint |
14 | 9 | - sloglint |
15 | | - |
| 10 | + - testifylint |
| 11 | + settings: |
| 12 | + depguard: |
| 13 | + rules: |
| 14 | + main: |
| 15 | + deny: |
| 16 | + - pkg: sync/atomic |
| 17 | + desc: "Use go.uber.org/atomic instead of sync/atomic" |
| 18 | + - pkg: github.com/stretchr/testify/assert |
| 19 | + desc: "Use github.com/stretchr/testify/require instead of github.com/stretchr/testify/assert" |
| 20 | + - pkg: github.com/go-kit/kit/log |
| 21 | + desc: "Use github.com/go-kit/log instead of github.com/go-kit/kit/log" |
| 22 | + - pkg: github.com/pkg/errors |
| 23 | + desc: "Use errors or fmt instead of github.com/pkg/errors" |
| 24 | + errcheck: |
| 25 | + exclude-functions: |
| 26 | + # Don't flag lines such as "io.Copy(io.Discard, resp.Body)". |
| 27 | + - io.Copy |
| 28 | + # The next two are used in HTTP handlers, any error is handled by the server itself. |
| 29 | + - io.WriteString |
| 30 | + - (net/http.ResponseWriter).Write |
| 31 | + # No need to check for errors on server's shutdown. |
| 32 | + - (*net/http.Server).Shutdown |
| 33 | + # Never check for rollback errors as Rollback() is called when a previous error was detected. |
| 34 | + - (github.com/prometheus/prometheus/storage.Appender).Rollback |
| 35 | + godot: |
| 36 | + scope: toplevel |
| 37 | + exclude: |
| 38 | + - "^ ?This file is safe to edit" |
| 39 | + - "^ ?scheme value" |
| 40 | + period: true |
| 41 | + capital: true |
| 42 | + revive: |
| 43 | + rules: |
| 44 | + - name: blank-imports |
| 45 | + - name: context-as-argument |
| 46 | + - name: error-naming |
| 47 | + - name: error-return |
| 48 | + - name: error-strings |
| 49 | + - name: errorf |
| 50 | + - name: exported |
| 51 | + arguments: |
| 52 | + - disableStutteringCheck |
| 53 | + - name: if-return |
| 54 | + - name: increment-decrement |
| 55 | + - name: indent-error-flow |
| 56 | + - name: package-comments |
| 57 | + - name: range |
| 58 | + - name: receiver-naming |
| 59 | + - name: time-naming |
| 60 | + - name: unexported-return |
| 61 | + - name: var-declaration |
| 62 | + - name: var-naming |
| 63 | + testifylint: |
| 64 | + disable: |
| 65 | + - float-compare |
| 66 | + - go-require |
| 67 | + enable-all: true |
| 68 | + exclusions: |
| 69 | + presets: |
| 70 | + - comments |
| 71 | + - common-false-positives |
| 72 | + - legacy |
| 73 | + - std-error-handling |
| 74 | + paths: |
| 75 | + # Skip autogenerated files. |
| 76 | + - ^.*\.(pb|y)\.go$ |
| 77 | + rules: |
| 78 | + - linters: |
| 79 | + - errcheck |
| 80 | + path: _test.go |
| 81 | + warn-unused: true |
16 | 82 | issues: |
17 | 83 | max-issues-per-linter: 0 |
18 | 84 | max-same-issues: 0 |
19 | | - exclude-rules: |
20 | | - - path: _test.go |
21 | | - linters: |
22 | | - - errcheck |
23 | | - exclude-files: |
24 | | - # Skip autogenerated files. |
25 | | - - ^.*\.(pb|y)\.go$ |
26 | | - |
27 | 85 | run: |
28 | 86 | timeout: 5m |
29 | | - |
30 | | -linters-settings: |
31 | | - depguard: |
32 | | - rules: |
33 | | - main: |
34 | | - deny: |
35 | | - - pkg: sync/atomic |
36 | | - desc: "Use go.uber.org/atomic instead of sync/atomic" |
37 | | - - pkg: github.com/stretchr/testify/assert |
38 | | - desc: "Use github.com/stretchr/testify/require instead of github.com/stretchr/testify/assert" |
39 | | - - pkg: github.com/go-kit/kit/log |
40 | | - desc: "Use github.com/go-kit/log instead of github.com/go-kit/kit/log" |
41 | | - - pkg: github.com/pkg/errors |
42 | | - desc: "Use errors or fmt instead of github.com/pkg/errors" |
43 | | - errcheck: |
44 | | - exclude-functions: |
45 | | - # Don't flag lines such as "io.Copy(io.Discard, resp.Body)". |
46 | | - - io.Copy |
47 | | - # The next two are used in HTTP handlers, any error is handled by the server itself. |
48 | | - - io.WriteString |
49 | | - - (net/http.ResponseWriter).Write |
50 | | - # No need to check for errors on server's shutdown. |
51 | | - - (*net/http.Server).Shutdown |
52 | | - # Never check for rollback errors as Rollback() is called when a previous error was detected. |
53 | | - - (github.com/prometheus/prometheus/storage.Appender).Rollback |
54 | | - godot: |
55 | | - scope: toplevel |
56 | | - exclude: |
57 | | - - "^ ?This file is safe to edit" |
58 | | - - "^ ?scheme value" |
59 | | - period: true |
60 | | - capital: true |
61 | | - goimports: |
62 | | - local-prefixes: github.com/prometheus/alertmanager |
63 | | - gofumpt: |
64 | | - extra-rules: true |
65 | | - revive: |
66 | | - rules: |
67 | | - - name: exported |
68 | | - arguments: ["disableStutteringCheck"] |
69 | | - - name: blank-imports |
70 | | - - name: context-as-argument |
71 | | - - name: error-return |
72 | | - - name: error-strings |
73 | | - - name: error-naming |
74 | | - - name: if-return |
75 | | - - name: increment-decrement |
76 | | - - name: var-naming |
77 | | - - name: var-declaration |
78 | | - - name: package-comments |
79 | | - - name: range |
80 | | - - name: receiver-naming |
81 | | - - name: time-naming |
82 | | - - name: unexported-return |
83 | | - - name: indent-error-flow |
84 | | - - name: errorf |
85 | | - testifylint: |
86 | | - disable: |
87 | | - - float-compare |
88 | | - - go-require |
89 | | - enable: |
90 | | - - bool-compare |
91 | | - - compares |
92 | | - - empty |
93 | | - - error-is-as |
94 | | - - error-nil |
95 | | - - expected-actual |
96 | | - - len |
97 | | - - require-error |
98 | | - - suite-dont-use-pkg |
99 | | - - suite-extra-assert-call |
| 87 | +formatters: |
| 88 | + enable: |
| 89 | + - gofumpt |
| 90 | + - goimports |
| 91 | + settings: |
| 92 | + gofumpt: |
| 93 | + extra-rules: true |
| 94 | + goimports: |
| 95 | + local-prefixes: |
| 96 | + - github.com/prometheus/alertmanager |
0 commit comments