|
| 1 | +version: "2" |
1 | 2 | run: |
2 | | - # timeout for analysis |
3 | | - timeout: 4m |
4 | 3 | go: "1.23" |
| 4 | +linters: |
| 5 | + default: all |
| 6 | + disable: |
| 7 | + # Global variables are used in many places throughout the code base. |
| 8 | + - gochecknoglobals |
5 | 9 |
|
6 | | -linters-settings: |
7 | | - lll: |
8 | | - line-length: 80 |
9 | | - govet: |
10 | | - # Don't report about shadowed variables |
11 | | - shadow: false |
12 | | - gofmt: |
13 | | - # simplify code: gofmt with `-s` option, true by default |
14 | | - simplify: true |
15 | | - tagliatelle: |
16 | | - case: |
17 | | - rules: |
18 | | - json: snake |
19 | | - whitespace: |
20 | | - multi-func: true |
21 | | - multi-if: true |
22 | | - gosec: |
23 | | - excludes: |
24 | | - - G402 # Look for bad TLS connection settings. |
25 | | - - G306 # Poor file permissions used when writing to a new file. |
26 | | - - G115 # Integer overflow conversion. |
27 | | - staticcheck: |
28 | | - checks: ["-SA1019"] |
29 | | - revive: |
30 | | - rules: |
31 | | - - name: exported # To enforce conventions around exported comments. |
| 10 | + # We want to allow short variable names. |
| 11 | + - varnamelen |
32 | 12 |
|
33 | | -issues: |
34 | | - include: |
35 | | - - EXC0012 # revive: Exported vars should have a docstring. |
36 | | - - EXC0014 # revive: Exported vars's docstring should start with its name. |
| 13 | + # We want to allow TODOs. |
| 14 | + - godox |
37 | 15 |
|
38 | | -linters: |
39 | | - enable-all: true |
40 | | - disable: |
41 | | - # Global variables are used in many places throughout the code base. |
42 | | - - gochecknoglobals |
| 16 | + # We have long functions, especially in tests. Moving or renaming those would |
| 17 | + # trigger funlen problems that we may not want to solve at that time. |
| 18 | + - funlen |
43 | 19 |
|
44 | | - # We want to allow short variable names. |
45 | | - - varnamelen |
| 20 | + # Disable for now as we haven't yet tuned the sensitivity to our codebase |
| 21 | + # yet. Enabling by default for example, would also force new contributors to |
| 22 | + # potentially extensively refactor code, when they want to smaller change to |
| 23 | + # land. |
| 24 | + - gocyclo |
| 25 | + - gocognit |
| 26 | + - cyclop |
46 | 27 |
|
47 | | - # We want to allow TODOs. |
48 | | - - godox |
| 28 | + # Instances of table driven tests that don't pre-allocate shouldn't trigger |
| 29 | + # the linter. |
| 30 | + - prealloc |
49 | 31 |
|
50 | | - # We have long functions, especially in tests. Moving or renaming those would |
51 | | - # trigger funlen problems that we may not want to solve at that time. |
52 | | - - funlen |
| 32 | + # Init functions are used by loggers throughout the codebase. |
| 33 | + - gochecknoinits |
53 | 34 |
|
54 | | - # Disable for now as we haven't yet tuned the sensitivity to our codebase |
55 | | - # yet. Enabling by default for example, would also force new contributors to |
56 | | - # potentially extensively refactor code, when they want to smaller change to |
57 | | - # land. |
58 | | - - gocyclo |
59 | | - - gocognit |
60 | | - - cyclop |
| 35 | + # Causes stack overflow, see https://github.com/polyfloyd/go-errorlint/issues/19. |
| 36 | + - errorlint |
61 | 37 |
|
62 | | - # Instances of table driven tests that don't pre-allocate shouldn't trigger |
63 | | - # the linter. |
64 | | - - prealloc |
| 38 | + # Don't forbid an empty line after function signature. We add it in multi-line case. |
| 39 | + - wsl_v5 |
65 | 40 |
|
66 | | - # Init functions are used by loggers throughout the codebase. |
67 | | - - gochecknoinits |
| 41 | + # Don't forbid "if err := ...; err != nil" checks. |
| 42 | + - noinlineerr |
68 | 43 |
|
69 | | - # Causes stack overflow, see https://github.com/polyfloyd/go-errorlint/issues/19. |
70 | | - - errorlint |
| 44 | + # Don't demand any particular functions order. |
| 45 | + - funcorder |
71 | 46 |
|
72 | | - # New linters that need a code adjustment first. |
73 | | - - wrapcheck |
74 | | - - nolintlint |
75 | | - - paralleltest |
76 | | - - tparallel |
77 | | - - testpackage |
78 | | - - gofumpt |
79 | | - - gomoddirectives |
80 | | - - ireturn |
81 | | - - maintidx |
82 | | - - nlreturn |
83 | | - - dogsled |
84 | | - - gci |
85 | | - - containedctx |
86 | | - - contextcheck |
87 | | - - errname |
88 | | - - err113 |
89 | | - - mnd |
90 | | - - noctx |
91 | | - - nestif |
92 | | - - wsl |
93 | | - - exhaustive |
94 | | - - forcetypeassert |
95 | | - - nilerr |
96 | | - - nilnil |
97 | | - - stylecheck |
98 | | - - thelper |
99 | | - - exhaustruct |
100 | | - - importas |
101 | | - - interfacebloat |
102 | | - - protogetter |
103 | | - - depguard |
104 | | - - mnd |
105 | | - - perfsprint |
106 | | - - inamedparam |
| 47 | + # New linters that need a code adjustment first. |
| 48 | + - containedctx |
| 49 | + - contextcheck |
| 50 | + - depguard |
| 51 | + - dogsled |
| 52 | + - err113 |
| 53 | + - errname |
| 54 | + - exhaustive |
| 55 | + - exhaustruct |
| 56 | + - forcetypeassert |
| 57 | + - gomoddirectives |
| 58 | + - importas |
| 59 | + - inamedparam |
| 60 | + - interfacebloat |
| 61 | + - ireturn |
| 62 | + - maintidx |
| 63 | + - mnd |
| 64 | + - nestif |
| 65 | + - nilerr |
| 66 | + - nilnil |
| 67 | + - nlreturn |
| 68 | + - noctx |
| 69 | + - nolintlint |
| 70 | + - paralleltest |
| 71 | + - perfsprint |
| 72 | + - protogetter |
| 73 | + - testpackage |
| 74 | + - thelper |
| 75 | + - tparallel |
| 76 | + - wrapcheck |
| 77 | + - wsl |
| 78 | + settings: |
| 79 | + gosec: |
| 80 | + excludes: |
| 81 | + - G402 # Look for bad TLS connection settings. |
| 82 | + - G306 # Poor file permissions used when writing to a new file. |
| 83 | + - G115 # Integer overflow conversion. |
| 84 | + lll: |
| 85 | + line-length: 80 |
| 86 | + revive: |
| 87 | + rules: |
| 88 | + - name: exported # To enforce conventions around exported comments. |
| 89 | + staticcheck: |
| 90 | + checks: |
| 91 | + - -SA1019 |
| 92 | + tagliatelle: |
| 93 | + case: |
| 94 | + rules: |
| 95 | + json: snake |
| 96 | + whitespace: |
| 97 | + multi-if: true |
| 98 | + multi-func: true |
| 99 | + exclusions: |
| 100 | + generated: lax |
| 101 | + presets: |
| 102 | + - common-false-positives |
| 103 | + - legacy |
| 104 | + - std-error-handling |
| 105 | + paths: |
| 106 | + - third_party$ |
| 107 | + - builtin$ |
| 108 | + - examples$ |
| 109 | +formatters: |
| 110 | + enable: |
| 111 | + - gofmt |
| 112 | + - goimports |
| 113 | + settings: |
| 114 | + gofmt: |
| 115 | + # simplify code: gofmt with `-s` option, true by default |
| 116 | + simplify: true |
| 117 | + exclusions: |
| 118 | + generated: lax |
| 119 | + paths: |
| 120 | + - third_party$ |
| 121 | + - builtin$ |
| 122 | + - examples$ |
0 commit comments