|
| 1 | +version: "2" |
| 2 | + |
1 | 3 | run: |
2 | 4 | timeout: 5m |
3 | 5 | tests: false |
4 | 6 |
|
5 | 7 | linters: |
6 | 8 | enable: |
7 | 9 | - errcheck # Check for unchecked errors |
8 | | - - gosimple # Simplify code |
9 | 10 | - govet # Report suspicious constructs |
10 | 11 | - ineffassign # Detect ineffective assignments |
11 | | - - staticcheck # Go static analysis |
| 12 | + - staticcheck # Go static analysis (includes gosimple) |
12 | 13 | - unused # Find unused code |
13 | | - - gofmt # Check formatting |
14 | 14 | - misspell # Fix spelling errors |
15 | | - - goimports # Manage imports |
16 | 15 | - gocritic # Opinionated linter |
17 | 16 | - gosec # Security checks |
18 | 17 | - prealloc # Slice preallocation hints |
19 | 18 | - unconvert # Remove unnecessary conversions |
20 | 19 | - unparam # Find unused function parameters |
21 | 20 | - nilerr # Check for nil error returns |
22 | 21 |
|
23 | | -linters-settings: |
24 | | - errcheck: |
25 | | - check-type-assertions: true |
26 | | - check-blank: true |
27 | | - exclude-functions: |
28 | | - - (io.Closer).Close |
29 | | - - (*os.File).Close |
30 | | - - (net.Conn).Close |
31 | | - |
32 | | - govet: |
33 | | - enable-all: true |
34 | | - disable: |
35 | | - - fieldalignment # Too noisy for now |
36 | | - |
37 | | - staticcheck: |
38 | | - checks: ["all"] |
39 | | - |
40 | | - gosec: |
41 | | - excludes: |
42 | | - - G104 # Audit errors not checked (handled by errcheck) |
43 | | - - G304 # File path provided as taint input (often intentional) |
44 | | - |
45 | | - gocritic: |
46 | | - enabled-tags: |
47 | | - - diagnostic |
48 | | - - performance |
49 | | - - style |
50 | | - disabled-checks: |
51 | | - - hugeParam # Too strict for typical structs |
52 | | - - rangeValCopy # Often not worth micro-optimizing |
53 | | - |
54 | | - misspell: |
55 | | - locale: US |
56 | | - |
57 | | - goimports: |
58 | | - local-prefixes: windshift |
59 | | - |
60 | | -issues: |
61 | | - exclude-use-default: false |
62 | | - max-issues-per-linter: 50 |
63 | | - max-same-issues: 10 |
64 | | - |
65 | | - exclude-rules: |
66 | | - # Ignore long lines in generated files |
67 | | - - path: _gen\.go |
68 | | - linters: |
69 | | - - lll |
70 | | - |
71 | | - # Allow unused parameters in main package |
72 | | - - path: main\.go |
73 | | - linters: |
74 | | - - unparam |
75 | | - |
76 | | - # Ignore magic numbers in tests |
77 | | - - path: _test\.go |
78 | | - linters: |
79 | | - - gomnd |
80 | | - |
81 | | - # Allow dot imports in tests |
82 | | - - path: _test\.go |
83 | | - linters: |
84 | | - - revive |
85 | | - text: "dot-imports" |
| 22 | + settings: |
| 23 | + errcheck: |
| 24 | + check-type-assertions: true |
| 25 | + check-blank: true |
| 26 | + exclude-functions: |
| 27 | + - (io.Closer).Close |
| 28 | + - (*os.File).Close |
| 29 | + - (net.Conn).Close |
| 30 | + |
| 31 | + govet: |
| 32 | + enable-all: true |
| 33 | + disable: |
| 34 | + - fieldalignment # Too noisy for now |
| 35 | + |
| 36 | + staticcheck: |
| 37 | + checks: ["all"] |
| 38 | + |
| 39 | + gosec: |
| 40 | + excludes: |
| 41 | + - G104 # Audit errors not checked (handled by errcheck) |
| 42 | + - G304 # File path provided as taint input (often intentional) |
| 43 | + |
| 44 | + gocritic: |
| 45 | + enabled-tags: |
| 46 | + - diagnostic |
| 47 | + - performance |
| 48 | + - style |
| 49 | + disabled-checks: |
| 50 | + - hugeParam # Too strict for typical structs |
| 51 | + - rangeValCopy # Often not worth micro-optimizing |
| 52 | + |
| 53 | + misspell: |
| 54 | + locale: US |
| 55 | + |
| 56 | + exclusions: |
| 57 | + generated: lax |
| 58 | + presets: [] |
| 59 | + max-issues-per-linter: 50 |
| 60 | + max-same-issues: 10 |
| 61 | + |
| 62 | + rules: |
| 63 | + # Ignore long lines in generated files |
| 64 | + - path: _gen\.go |
| 65 | + linters: |
| 66 | + - lll |
| 67 | + |
| 68 | + # Allow unused parameters in main package |
| 69 | + - path: main\.go |
| 70 | + linters: |
| 71 | + - unparam |
| 72 | + |
| 73 | + # Ignore magic numbers in tests |
| 74 | + - path: _test\.go |
| 75 | + linters: |
| 76 | + - mnd |
| 77 | + |
| 78 | + # Allow dot imports in tests |
| 79 | + - path: _test\.go |
| 80 | + linters: |
| 81 | + - revive |
| 82 | + text: "dot-imports" |
| 83 | + |
| 84 | +formatters: |
| 85 | + enable: |
| 86 | + - gofmt # Check formatting |
| 87 | + - goimports # Manage imports |
| 88 | + |
| 89 | + settings: |
| 90 | + goimports: |
| 91 | + local-prefixes: windshift |
86 | 92 |
|
87 | 93 | output: |
88 | 94 | formats: |
89 | | - - format: colored-line-number |
90 | | - print-issued-lines: true |
91 | | - print-linter-name: true |
92 | | - sort-results: true |
| 95 | + text: |
| 96 | + colors: true |
| 97 | + print-issued-lines: true |
| 98 | + print-linter-name: true |
| 99 | + sort-order: |
| 100 | + - file |
0 commit comments