|
1 | 1 | # GolangCI-Lint settings |
2 | | - |
| 2 | +version: "2" |
3 | 3 | # Disable all linters and enable the required ones |
4 | 4 | linters: |
5 | | - disable-all: true |
| 5 | + default: none |
6 | 6 |
|
7 | 7 | # Supported linters: https://golangci-lint.run/usage/linters/ |
8 | 8 | enable: |
9 | | - - errcheck |
10 | | - - gosimple |
11 | | - - govet |
12 | | - - ineffassign |
13 | | - - staticcheck |
14 | | - - typecheck |
15 | | - - unused |
| 9 | + - asasalint |
| 10 | + - asciicheck |
| 11 | + - bidichk |
16 | 12 | - bodyclose |
| 13 | + - containedctx |
| 14 | + - copyloopvar |
| 15 | + - decorder |
17 | 16 | - dupl |
| 17 | + - dupword |
| 18 | + - durationcheck |
| 19 | + - errcheck |
| 20 | + - errchkjson |
| 21 | + - errname |
| 22 | + - errorlint |
| 23 | + - exptostd |
| 24 | + - fatcontext |
| 25 | + - forbidigo |
| 26 | + - forcetypeassert |
| 27 | + - ginkgolinter |
| 28 | + - gocheckcompilerdirectives |
18 | 29 | - gochecknoinits |
| 30 | + - gochecksumtype |
| 31 | + - gocognit |
19 | 32 | - goconst |
20 | 33 | - gocritic |
21 | 34 | - gocyclo |
22 | | - - gofmt |
23 | | - - goimports |
| 35 | + - goprintffuncname |
24 | 36 | - gosec |
| 37 | + - govet |
| 38 | + - grouper |
| 39 | + - iface |
| 40 | + - importas |
| 41 | + - ineffassign |
| 42 | + - interfacebloat |
25 | 43 | - lll |
| 44 | + - loggercheck |
| 45 | + - makezero |
| 46 | + - mirror |
26 | 47 | - misspell |
| 48 | + - musttag |
27 | 49 | - nakedret |
| 50 | + - nestif |
| 51 | + - nilerr |
| 52 | + - nilnesserr |
| 53 | + - noctx |
| 54 | + - nolintlint |
| 55 | + - nosprintfhostport |
28 | 56 | - prealloc |
29 | | - - stylecheck |
| 57 | + - predeclared |
| 58 | + - reassign |
| 59 | + - rowserrcheck |
| 60 | + - sqlclosecheck |
| 61 | + - staticcheck |
| 62 | + - testableexamples |
| 63 | + - tparallel |
30 | 64 | - unconvert |
31 | 65 | - unparam |
32 | | - - paralleltest |
33 | | - - forbidigo |
34 | | - fast: false |
| 66 | + - unused |
| 67 | + - usestdlibvars |
| 68 | + - usetesting |
| 69 | + - wastedassign |
| 70 | + - zerologlint |
| 71 | + |
| 72 | + # Specific linter settings |
| 73 | + settings: |
| 74 | + gocognit: |
| 75 | + # Minimal code complexity to report |
| 76 | + min-complexity: 16 |
| 77 | + gocyclo: |
| 78 | + # Minimal code complexity to report |
| 79 | + min-complexity: 16 |
| 80 | + misspell: |
| 81 | + # Correct spellings using locale preferences for US |
| 82 | + locale: US |
| 83 | + staticcheck: |
| 84 | + # Default list with custom silencing of: |
| 85 | + |
| 86 | + checks: [ |
| 87 | + "all", |
| 88 | + # Disable the checks that staticcheck disables by default |
| 89 | + "-ST1000", |
| 90 | + "-ST1003", |
| 91 | + "-ST1016", |
| 92 | + "-ST1020", |
| 93 | + "-ST1021", |
| 94 | + "-ST1022", |
| 95 | + "-QF1008", # Omit embedded fields from selector expression. |
| 96 | + ] |
| 97 | + exclusions: |
| 98 | + rules: |
| 99 | + # Exclude gochecknoinits and gosec from running on tests files |
| 100 | + - path: _test\.go |
| 101 | + linters: |
| 102 | + - dupl |
| 103 | + - gochecknoinits |
| 104 | + - gosec |
| 105 | + - errcheck |
| 106 | + - gocognit |
| 107 | + - musttag |
| 108 | + - noctx |
| 109 | + - usestdlibvars |
| 110 | + - exhaustruct |
| 111 | + - copyloopvar |
| 112 | + - goconst |
| 113 | + - path: test/* |
| 114 | + linters: |
| 115 | + - gochecknoinits |
| 116 | + - gosec |
| 117 | + - gocognit |
| 118 | + # Exclude lll issues for long lines with go:generate |
| 119 | + - linters: |
| 120 | + - lll |
| 121 | + source: "^//go:generate " |
| 122 | + paths: |
| 123 | + - .go/pkg/mod |
| 124 | + - vendor-fork |
| 125 | + - internal/logreporter/api/loki |
35 | 126 |
|
36 | 127 | # Run options |
37 | 128 | run: |
38 | 129 | # 10 minute timeout for analysis |
39 | 130 | timeout: 10m |
40 | | -# Specific linter settings |
41 | | -linters-settings: |
42 | | - gocyclo: |
43 | | - # Minimal code complexity to report |
44 | | - min-complexity: 16 |
45 | | - govet: |
46 | | - disable-all: true |
47 | | - enable: |
48 | | - # Report shadowed variables |
49 | | - - shadow |
50 | | - |
51 | | - misspell: |
52 | | - # Correct spellings using locale preferences for US |
53 | | - locale: US |
54 | | - goimports: |
55 | | - # Put imports beginning with prefix after 3rd-party packages |
56 | | - local-prefixes: gitswarm.f5net.com/indigo,gitlab.com/f5 |
57 | | - exhaustruct: |
58 | | - # List of regular expressions to match struct packages and names. |
59 | | - # If this list is empty, all structs are tested. |
60 | | - # Default: [] |
61 | | - include: |
62 | | - - "gitlab.com/f5/nginx/nginxazurelb/azure-resource-provider/pkg/token.TokenID" |
63 | | - - "gitlab.com/f5/nginx/nginxazurelb/azure-resource-provider/internal/dpo/agent/certificates.CertGetRequest" |
64 | 131 |
|
65 | 132 | issues: |
66 | | - exclude-dirs: |
67 | | - - .go/pkg/mod |
68 | | - # Exclude configuration |
69 | | - exclude-rules: |
70 | | - # Exclude gochecknoinits and gosec from running on tests files |
71 | | - - path: _test\.go |
72 | | - linters: |
73 | | - - gochecknoinits |
74 | | - - gosec |
75 | | - - path: test/* |
76 | | - linters: |
77 | | - - gochecknoinits |
78 | | - - gosec |
79 | | - # Exclude lll issues for long lines with go:generate |
80 | | - - linters: |
81 | | - - lll |
82 | | - source: "^//go:generate " |
83 | | - # Exclude false positive paralleltest error : Range statement for test case does not use range value in test Run |
84 | | - - linters: |
85 | | - - paralleltest |
86 | | - text: "does not use range value in test Run" |
87 | | - |
88 | 133 | # Disable maximum issues count per one linter |
89 | 134 | max-issues-per-linter: 0 |
90 | 135 |
|
|
0 commit comments