|
1 | 1 | # This file contains all available configuration options |
2 | 2 | # with their default values. |
3 | 3 |
|
| 4 | +version: "2" |
| 5 | + |
4 | 6 | # options for analysis running |
5 | 7 | run: |
6 | 8 | # default concurrency is a available CPU number |
7 | 9 | concurrency: 4 |
8 | | - |
9 | | - # timeout for analysis, e.g. 30s, 5m, default is 1m |
10 | | - timeout: 5m |
11 | | -linters-settings: |
12 | | - goimports: |
13 | | - # put imports beginning with prefix after 3rd-party packages; |
14 | | - # it's a comma-separated list of prefixes |
15 | | - local-prefixes: github.com/stackitcloud/stackit-sdk-go |
16 | | - depguard: |
17 | | - rules: |
18 | | - main: |
19 | | - list-mode: lax # Everything is allowed unless it is denied |
20 | | - deny: |
21 | | - - pkg: "github.com/stretchr/testify" |
22 | | - desc: Do not use a testing framework |
23 | | - misspell: |
24 | | - # Correct spellings using locale preferences for US or UK. |
25 | | - # Default is to use a neutral variety of English. |
26 | | - # Setting locale to US will correct the British spelling of 'colour' to 'color'. |
27 | | - locale: US |
28 | | - golint: |
29 | | - min-confidence: 0.8 |
30 | | - gosec: |
31 | | - excludes: |
32 | | - # Suppressions: (see https://github.com/securego/gosec#available-rules for details) |
33 | | - - G104 # "Audit errors not checked" -> which we don't need and is a badly implemented version of errcheck |
34 | | - - G102 # "Bind to all interfaces" -> since this is normal in k8s |
35 | | - - G304 # "File path provided as taint input" -> too many false positives |
36 | | - - G307 # "Deferring unsafe method "Close" on type "io.ReadCloser" -> false positive when calling defer resp.Body.Close() |
37 | | - nakedret: |
38 | | - max-func-lines: 0 |
39 | | - revive: |
40 | | - ignore-generated-header: true |
41 | | - severity: error |
42 | | - # https://github.com/mgechev/revive |
43 | | - rules: |
44 | | - - name: errorf |
45 | | - - name: context-as-argument |
46 | | - - name: error-return |
47 | | - - name: increment-decrement |
48 | | - - name: indent-error-flow |
49 | | - - name: superfluous-else |
50 | | - - name: unused-parameter |
51 | | - - name: unreachable-code |
52 | | - - name: atomic |
53 | | - - name: empty-lines |
54 | | - - name: early-return |
55 | | - gocritic: |
56 | | - enabled-tags: |
57 | | - - performance |
58 | | - - style |
59 | | - - experimental |
60 | | - disabled-checks: |
61 | | - - wrapperFunc |
62 | | - - typeDefFirst |
63 | | - - ifElseChain |
64 | | - - dupImport # https://github.com/go-critic/go-critic/issues/845 |
65 | 10 | linters: |
66 | 11 | enable: |
67 | | - # https://golangci-lint.run/usage/linters/ |
68 | | - # default linters |
69 | | - - gosimple |
70 | | - - govet |
71 | | - - ineffassign |
72 | | - - staticcheck |
73 | | - - typecheck |
74 | | - - unused |
75 | | - # additional linters |
| 12 | + - bodyclose |
| 13 | + - depguard |
76 | 14 | - errorlint |
| 15 | + - forcetypeassert |
77 | 16 | - gochecknoinits |
78 | 17 | - gocritic |
79 | | - - gofmt |
80 | | - - goimports |
81 | 18 | - gosec |
82 | 19 | - misspell |
83 | 20 | - nakedret |
84 | 21 | - revive |
85 | | - - depguard |
86 | | - - bodyclose |
87 | 22 | - sqlclosecheck |
88 | 23 | - wastedassign |
89 | | - - forcetypeassert |
90 | | - - errcheck |
91 | 24 | disable: |
92 | 25 | - noctx # false positive: finds errors with http.NewRequest that dont make sense |
93 | 26 | - unparam # false positives |
94 | | -issues: |
95 | | - exclude-use-default: false |
96 | | - exclude-rules: |
97 | | - # This ignores all deprecation warnings in the old wait packages while we have the compatibilty layer in place |
98 | | - - path: ^wait/[^/]+\.go$ |
99 | | - linters: |
100 | | - - staticcheck |
101 | | - text: "SA1019:" |
102 | | -go: 1.25 |
| 27 | + settings: |
| 28 | + depguard: |
| 29 | + rules: |
| 30 | + main: |
| 31 | + list-mode: lax # Everything is allowed unless it is denied |
| 32 | + deny: |
| 33 | + - pkg: github.com/stretchr/testify |
| 34 | + desc: Do not use a testing framework |
| 35 | + gocritic: |
| 36 | + disabled-checks: |
| 37 | + - wrapperFunc |
| 38 | + - typeDefFirst |
| 39 | + - ifElseChain |
| 40 | + - dupImport # https://github.com/go-critic/go-critic/issues/845 |
| 41 | + enabled-tags: |
| 42 | + - performance |
| 43 | + - style |
| 44 | + - experimental |
| 45 | + gosec: |
| 46 | + excludes: |
| 47 | + # Suppressions: (see https://github.com/securego/gosec#available-rules for details) |
| 48 | + - G104 # "Audit errors not checked" -> which we don't need and is a badly implemented version of errcheck |
| 49 | + - G102 # "Bind to all interfaces" -> since this is normal in k8s |
| 50 | + - G304 # "File path provided as taint input" -> too many false positives |
| 51 | + - G307 # "Deferring unsafe method "Close" on type "io.ReadCloser" -> false positive when calling defer resp.Body.Close() |
| 52 | + - G117 # "Marshaled struct field xxx (JSON key xxx) matches secret pattern" -> too many false positives, no true positives expected in our code |
| 53 | + - G704 # "SSRF via taint analysis" -> too many false positives |
| 54 | + misspell: |
| 55 | + # Correct spellings using locale preferences for US or UK. |
| 56 | + # Default is to use a neutral variety of English. |
| 57 | + # Setting locale to US will correct the British spelling of 'colour' to 'color'. |
| 58 | + locale: US |
| 59 | + nakedret: |
| 60 | + max-func-lines: 0 |
| 61 | + revive: |
| 62 | + severity: error |
| 63 | + # https://github.com/mgechev/revive |
| 64 | + rules: |
| 65 | + - name: errorf |
| 66 | + - name: context-as-argument |
| 67 | + - name: error-return |
| 68 | + - name: increment-decrement |
| 69 | + - name: indent-error-flow |
| 70 | + - name: superfluous-else |
| 71 | + - name: unused-parameter |
| 72 | + - name: unreachable-code |
| 73 | + - name: atomic |
| 74 | + - name: empty-lines |
| 75 | + - name: early-return |
| 76 | + exclusions: |
| 77 | + generated: lax |
| 78 | + rules: |
| 79 | + - linters: |
| 80 | + - staticcheck |
| 81 | + # This ignores all deprecation warnings in the old wait packages while we have the compatibilty layer in place |
| 82 | + path: wait/[^/]+\.go$ |
| 83 | + text: "SA1019:" |
| 84 | +formatters: |
| 85 | + enable: |
| 86 | + - gofmt |
| 87 | + - goimports |
| 88 | + settings: |
| 89 | + goimports: |
| 90 | + # put imports beginning with prefix after 3rd-party packages; |
| 91 | + # it's a comma-separated list of prefixes |
| 92 | + local-prefixes: |
| 93 | + - github.com/stackitcloud/stackit-sdk-go |
| 94 | + exclusions: |
| 95 | + generated: lax |
0 commit comments