|
1 |
| -issues: |
2 |
| - # The default exclude list seems rather aggressive, opt-in when needed instead |
3 |
| - exclude-use-default: false |
4 |
| - |
5 |
| - exclude-rules: |
6 |
| - # Duplicated errcheck checks |
7 |
| - - linters: [gosec] |
8 |
| - text: G104 |
9 |
| - # Duplicated errcheck checks |
10 |
| - - linters: [staticcheck] |
11 |
| - text: SA5001 |
12 |
| - # We don't require comments on everything |
13 |
| - - linters: [golint] |
14 |
| - text: should have( a package)? comment |
15 |
| - # very long lines are ok if they're URLs |
16 |
| - - linters: [lll] |
17 |
| - source: https?:// |
18 |
| - # very long lines are ok if they're go:generate |
19 |
| - - linters: [lll] |
20 |
| - source: "^//go:generate " |
21 |
| - # Ignore errcheck on deferred Close |
22 |
| - - linters: [errcheck] |
23 |
| - source: ^\s*defer .*\.Close(.*)$ |
24 |
| - # Ignore ineffective assignments to ctx |
25 |
| - - linters: [ineffassign] |
26 |
| - source: ^\s*ctx.*=.*$ |
27 |
| - - linters: [staticcheck] |
28 |
| - source: ^\s*ctx.*=.*$ |
29 |
| - # Don't require package docs |
30 |
| - - linters: [stylecheck] |
31 |
| - text: ST1000 |
32 |
| - # Unparam is allowed in tests |
33 |
| - - linters: [unparam] |
34 |
| - path: _test\.go |
35 |
| - |
| 1 | +version: "2" |
36 | 2 | linters:
|
37 |
| - disable-all: true |
| 3 | + default: none |
38 | 4 | enable:
|
39 | 5 | - bodyclose
|
40 | 6 | - depguard
|
41 | 7 | - errcheck
|
42 | 8 | - errorlint
|
| 9 | + - forbidigo |
43 | 10 | - goconst
|
44 | 11 | - gocyclo
|
45 |
| - - gofmt |
46 |
| - - goimports |
47 | 12 | - gosec
|
48 |
| - - gosimple |
49 | 13 | - govet
|
50 | 14 | - ineffassign
|
51 | 15 | - lll
|
52 | 16 | - misspell
|
53 | 17 | - nakedret
|
54 | 18 | - staticcheck
|
55 |
| - - stylecheck |
56 |
| - - typecheck |
57 | 19 | - unconvert
|
58 | 20 | - unparam
|
59 | 21 | - unused
|
60 |
| - - forbidigo |
61 |
| - |
62 |
| -linters-settings: |
63 |
| - govet: |
64 |
| - disable: |
65 |
| - - shadow |
66 |
| - gocyclo: |
67 |
| - min-complexity: 15 |
68 |
| - dupl: |
69 |
| - # Don't detect small duplications, but if we're duplicating functions across |
70 |
| - # packages, we should consider refactoring. |
71 |
| - threshold: 100 |
72 |
| - depguard: |
| 22 | + settings: |
| 23 | + depguard: |
| 24 | + rules: |
| 25 | + main: |
| 26 | + files: |
| 27 | + - $all |
| 28 | + deny: |
| 29 | + - pkg: github.com/pkg/errors |
| 30 | + desc: 'use Go 1.13 errors instead: https://blog.golang.org/go1.13-errors' |
| 31 | + testing: |
| 32 | + files: |
| 33 | + - $test |
| 34 | + deny: |
| 35 | + - pkg: github.com/stretchr/testify/assert |
| 36 | + desc: use github.com/stretchr/testify/require instead |
| 37 | + dupl: |
| 38 | + threshold: 100 |
| 39 | + forbidigo: |
| 40 | + forbid: |
| 41 | + - pattern: ^print.*$ |
| 42 | + - pattern: ^fmt\.Print.*$ |
| 43 | + msg: Do not commit print statements. |
| 44 | + - pattern: ^os\.Getenv |
| 45 | + msg: Pull values through configuration rather than os.Getenv |
| 46 | + goconst: |
| 47 | + min-len: 8 |
| 48 | + min-occurrences: 10 |
| 49 | + gocyclo: |
| 50 | + min-complexity: 15 |
| 51 | + govet: |
| 52 | + disable: |
| 53 | + - shadow |
| 54 | + lll: |
| 55 | + line-length: 180 |
| 56 | + exclusions: |
| 57 | + generated: lax |
73 | 58 | rules:
|
74 |
| - main: |
75 |
| - files: |
76 |
| - - '$all' |
77 |
| - deny: |
78 |
| - - pkg: "github.com/pkg/errors" |
79 |
| - desc: "use Go 1.13 errors instead: https://blog.golang.org/go1.13-errors" |
80 |
| - testing: |
81 |
| - files: ['$test'] |
82 |
| - deny: |
83 |
| - - pkg: "github.com/stretchr/testify/assert" |
84 |
| - desc: "use github.com/stretchr/testify/require instead" |
85 |
| - goconst: |
86 |
| - min-len: 8 |
87 |
| - min-occurrences: 10 |
88 |
| - lll: |
89 |
| - line-length: 180 |
90 |
| - forbidigo: |
91 |
| - # Forbid the following identifiers (list of regexp). |
92 |
| - # Default: ["^(fmt\\.Print(|f|ln)|print|println)$"] |
93 |
| - forbid: |
94 |
| - # Builtin function: |
95 |
| - - ^print.*$ |
96 |
| - - p: ^fmt\.Print.*$ |
97 |
| - msg: Do not commit print statements. |
98 |
| - - p: ^os\.Getenv |
99 |
| - msg: Pull values through configuration rather than os.Getenv |
| 59 | + - linters: |
| 60 | + - gosec |
| 61 | + text: G104 |
| 62 | + - linters: |
| 63 | + - staticcheck |
| 64 | + text: SA5001 |
| 65 | + - linters: |
| 66 | + - staticcheck |
| 67 | + text: QF1008 |
| 68 | + - linters: |
| 69 | + - golint |
| 70 | + text: should have( a package)? comment |
| 71 | + - linters: |
| 72 | + - lll |
| 73 | + source: https?:// |
| 74 | + - linters: |
| 75 | + - lll |
| 76 | + source: '^//go:generate ' |
| 77 | + - linters: |
| 78 | + - errcheck |
| 79 | + source: ^\s*defer .*\.Close(.*)$ |
| 80 | + - linters: |
| 81 | + - ineffassign |
| 82 | + source: ^\s*ctx.*=.*$ |
| 83 | + - linters: |
| 84 | + - staticcheck |
| 85 | + source: ^\s*ctx.*=.*$ |
| 86 | + - linters: |
| 87 | + - staticcheck |
| 88 | + text: ST1000 |
| 89 | + - linters: |
| 90 | + - unparam |
| 91 | + path: _test\.go |
| 92 | + paths: |
| 93 | + - third_party$ |
| 94 | + - builtin$ |
| 95 | + - examples$ |
| 96 | +formatters: |
| 97 | + enable: |
| 98 | + - gofmt |
| 99 | + - goimports |
| 100 | + exclusions: |
| 101 | + generated: lax |
| 102 | + paths: |
| 103 | + - third_party$ |
| 104 | + - builtin$ |
| 105 | + - examples$ |
0 commit comments