|
| 1 | +version: "2" |
1 | 2 | linters: |
2 | | - disable-all: true |
| 3 | + default: none |
3 | 4 | enable: |
4 | | - # Enabled by default: |
5 | | - - errcheck # Finds unchecked errors. |
6 | | - - gosimple # Finds potential simplifications. See also: https://staticcheck.io/docs/checks/#S. |
7 | | - - govet # See "go tool vet help". |
8 | | - - ineffassign # Finds assignments that are not used. |
9 | | - - staticcheck # See also: https://staticcheck.io/docs/checks/#SA. |
10 | | - - typecheck # Parses and type-checks Go code. |
11 | | - - unused # Finds unused consts, vars, funcs and types. |
12 | | - |
13 | | - # Enabled manually: |
14 | | - - asciicheck # Finds non-ASCII identifiers. |
15 | | - - bodyclose # Finds HTTP response bodies that are not closed. |
16 | | - - copyloopvar # Finds for loop variables that are overwritten. |
17 | | - - errorlint # Finds problems with error wrapping. |
18 | | - - goconst # Finds repeated strings that could be replaced by a const. |
19 | | - - gocyclo # Finds funcs with high cyclomatic complexity. |
20 | | - - godot # Finds comments that do not end with a period. |
21 | | - - gofumpt # Finds files that were not gofumpt-ed. |
22 | | - - gosec # Finds security problems. |
23 | | - - lll # Finds lines that exceed the line length limit. |
24 | | - - makezero # Finds combinations of `make([]T, n)` and `append()`. |
25 | | - - nakedret # Finds naked returns. |
26 | | - - nilnil # Finds `return nil, nil`. |
27 | | - - paralleltest # Finds tests that could be executed in parallel. |
28 | | - - prealloc # Finds slice declarations that could be pre-allocated. |
29 | | - - revive # Runs `revive` with our existing config. |
30 | | - - rowserrcheck # Finds incorrect error checking when working with sql.Rows. |
31 | | - - sqlclosecheck # Finds missing `Close()` when working with sql.Rows. |
32 | | - - stylecheck # See also: https://staticcheck.io/docs/checks/#ST. |
33 | | - - tenv # Finds incorrect use of `os.Setenv()` in tests. |
34 | | - - thelper # Finds test utilities witout `t.Helper()`. |
35 | | - - tparallel # Finds incorrect use of `t.Parallel()` in tests. |
36 | | - - unconvert # Finds unnecessary type conversions. |
37 | | - - unparam # Finds unused function parameters. |
38 | | - |
39 | | -linters-settings: |
40 | | - goconst: |
41 | | - min-len: 5 |
42 | | - min-occurrences: 5 |
43 | | - |
44 | | - gocyclo: |
45 | | - min-complexity: 20 |
46 | | - |
47 | | - godot: |
48 | | - capital: true |
49 | | - period: true |
50 | | - |
51 | | - gosec: |
52 | | - exclude-generated: true |
53 | | - |
54 | | - lll: |
55 | | - line-length: 120 |
56 | | - tab-width: 2 |
57 | | - |
58 | | - nakedret: |
59 | | - max-func-lines: 20 |
60 | | - |
61 | | - revive: |
62 | | - enable-all-rules: true |
| 5 | + - asciicheck |
| 6 | + - bodyclose |
| 7 | + - copyloopvar |
| 8 | + - errcheck |
| 9 | + - errorlint |
| 10 | + - goconst |
| 11 | + - gocyclo |
| 12 | + - godot |
| 13 | + - gosec |
| 14 | + - govet |
| 15 | + - ineffassign |
| 16 | + - lll |
| 17 | + - makezero |
| 18 | + - nakedret |
| 19 | + - nilnil |
| 20 | + - paralleltest |
| 21 | + - prealloc |
| 22 | + - revive |
| 23 | + - rowserrcheck |
| 24 | + - sqlclosecheck |
| 25 | + - staticcheck |
| 26 | + - thelper |
| 27 | + - tparallel |
| 28 | + - unconvert |
| 29 | + - unparam |
| 30 | + - unused |
| 31 | + settings: |
| 32 | + goconst: |
| 33 | + min-len: 5 |
| 34 | + min-occurrences: 5 |
| 35 | + gocyclo: |
| 36 | + min-complexity: 20 |
| 37 | + godot: |
| 38 | + capital: true |
| 39 | + period: true |
| 40 | + lll: |
| 41 | + line-length: 120 |
| 42 | + tab-width: 2 |
| 43 | + nakedret: |
| 44 | + max-func-lines: 20 |
| 45 | + revive: |
| 46 | + enable-all-rules: true |
| 47 | + rules: |
| 48 | + - name: add-constant |
| 49 | + disabled: true |
| 50 | + - name: argument-limit |
| 51 | + arguments: |
| 52 | + - 8 |
| 53 | + - name: bare-return |
| 54 | + disabled: true |
| 55 | + - name: banned-characters |
| 56 | + disabled: true |
| 57 | + - name: cognitive-complexity |
| 58 | + disabled: true |
| 59 | + - name: confusing-naming |
| 60 | + disabled: true |
| 61 | + - name: cyclomatic |
| 62 | + disabled: true |
| 63 | + - name: file-header |
| 64 | + arguments: |
| 65 | + - The Things Network Foundation, The Things Industries B.V. |
| 66 | + - name: flag-parameter |
| 67 | + disabled: true |
| 68 | + - name: function-length |
| 69 | + disabled: true |
| 70 | + - name: function-result-limit |
| 71 | + arguments: |
| 72 | + - 3 |
| 73 | + - name: line-length-limit |
| 74 | + disabled: true |
| 75 | + - name: max-public-structs |
| 76 | + disabled: true |
| 77 | + - name: nested-structs |
| 78 | + disabled: true |
| 79 | + - name: unhandled-error |
| 80 | + disabled: true |
| 81 | + staticcheck: |
| 82 | + checks: |
| 83 | + - all |
| 84 | + exclusions: |
| 85 | + generated: lax |
| 86 | + presets: |
| 87 | + - common-false-positives |
| 88 | + - std-error-handling |
63 | 89 | rules: |
64 | | - - name: add-constant |
65 | | - disabled: true # Already checked by goconst. |
66 | | - - name: argument-limit |
67 | | - arguments: [8] # We may want to lower this, because it's a lot. |
68 | | - - name: bare-return |
69 | | - disabled: true # Already checked by nakedret. |
70 | | - - name: banned-characters |
71 | | - disabled: true # We don't have any. |
72 | | - - name: cognitive-complexity |
73 | | - disabled: true # We may want to enable this in the future. |
74 | | - - name: confusing-naming |
75 | | - disabled: true # We do actually use methods that only differ by capitalization. |
76 | | - - name: cyclomatic |
77 | | - disabled: true # Already checked by gocyclo. |
78 | | - - name: file-header |
79 | | - arguments: ['The Things Network Foundation, The Things Industries B.V.'] |
80 | | - - name: flag-parameter |
81 | | - disabled: true # We do actually take boolean parameters in funcs. |
82 | | - - name: function-length |
83 | | - disabled: true # We do actually have some very long funcs. |
84 | | - - name: function-result-limit |
85 | | - arguments: [3] |
86 | | - - name: line-length-limit |
87 | | - disabled: true # Already checked by lll. |
88 | | - - name: max-public-structs |
89 | | - disabled: true |
90 | | - - name: nested-structs |
91 | | - disabled: true |
92 | | - - name: unhandled-error |
93 | | - disabled: true # Already checked by errcheck. |
94 | | - |
95 | | - stylecheck: |
96 | | - checks: |
97 | | - - all |
98 | | - |
99 | | -issues: |
100 | | - include: |
101 | | - - EXC0002 # golint: comments on exported things |
102 | | - - EXC0005 # staticcheck: unnecessary "break" in "switch" |
103 | | - - EXC0011 # stylecheck: comments on exported things |
104 | | - - EXC0012 # revive: comments on exported things |
105 | | - - EXC0013 # revive: package comments starting with package name |
106 | | - - EXC0014 # revive: exported thing comment starting with exported thing |
107 | | - exclude-rules: |
108 | | - # False positive: https://github.com/kunwardeep/paralleltest/issues/8. |
109 | | - - linters: |
110 | | - - paralleltest |
111 | | - text: 'does not use range value in test Run' |
112 | | - exclude-dirs: |
113 | | - - node_modules |
114 | | - |
| 90 | + - linters: |
| 91 | + - paralleltest |
| 92 | + text: does not use range value in test Run |
| 93 | + paths: |
| 94 | + - node_modules |
| 95 | + - third_party$ |
| 96 | + - builtin$ |
| 97 | + - examples$ |
| 98 | +formatters: |
| 99 | + enable: |
| 100 | + - gofumpt |
| 101 | + exclusions: |
| 102 | + generated: lax |
| 103 | + paths: |
| 104 | + - node_modules |
| 105 | + - third_party$ |
| 106 | + - builtin$ |
| 107 | + - examples$ |
0 commit comments