|
1 | | -linters-settings: |
2 | | - revive: |
3 | | - rules: |
4 | | - - name: dot-imports |
5 | | - arguments: |
6 | | - - allowedPackages: |
7 | | - - "github.com/onsi/ginkgo/v2" |
8 | | - - "github.com/onsi/gomega" |
9 | | - dupl: |
10 | | - threshold: 150 |
11 | | - funlen: |
12 | | - lines: 100 |
13 | | - statements: 50 |
14 | | - goconst: |
15 | | - min-len: 2 |
16 | | - min-occurrences: 2 |
17 | | - gocognit: |
18 | | - min-complexity: 30 |
19 | | - goimports: |
20 | | - local-prefixes: github.com/k8snetworkplumbingwg/rdma-cni |
21 | | - mnd: |
22 | | - # don't include the "operation" and "assign" |
23 | | - checks: [argument,case,condition,return] |
24 | | - govet: |
25 | | - settings: |
26 | | - printf: |
27 | | - funcs: |
28 | | - - (github.com/rs/zerolog/zerolog.Event).Msgf |
29 | | - lll: |
30 | | - line-length: 120 |
31 | | - misspell: |
32 | | - locale: US |
33 | | - prealloc: |
34 | | - # Report preallocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them. |
35 | | - # True by default. |
36 | | - simple: true |
37 | | - range-loops: true # Report preallocation suggestions on range loops, true by default |
38 | | - for-loops: false # Report preallocation suggestions on for loops, false by default |
| 1 | +# Tested with golangci-lint ver. 2.x |
| 2 | +version: "2" |
| 3 | + |
| 4 | +run: |
| 5 | + timeout: 10m |
39 | 6 |
|
40 | 7 | linters: |
41 | | - # please, do not use `enable-all`: it's deprecated and will be removed soon. |
42 | | - # inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint |
43 | | - disable-all: true |
| 8 | + default: none |
44 | 9 | enable: |
| 10 | + - asciicheck # checks for non-ASCII identifiers |
| 11 | + - bidichk # checks for dangerous unicode sequences (security) |
45 | 12 | - bodyclose |
| 13 | + - copyloopvar |
| 14 | + - depguard |
46 | 15 | - dogsled |
47 | 16 | - dupl |
48 | 17 | - errcheck |
| 18 | + - errname # checks error naming conventions |
| 19 | + - exhaustive |
49 | 20 | - funlen |
| 21 | + - gocheckcompilerdirectives # validates go compiler directives |
50 | 22 | - gochecknoinits |
| 23 | + - gocognit |
51 | 24 | - goconst |
52 | 25 | - gocritic |
53 | | - - gocognit |
54 | | - - gofmt |
55 | | - - goimports |
56 | | - - mnd |
57 | 26 | - goprintffuncname |
58 | 27 | - gosec |
59 | | - - gosimple |
| 28 | + - staticcheck |
60 | 29 | - govet |
61 | 30 | - ineffassign |
62 | 31 | - lll |
| 32 | + - makezero # finds slice declarations with non-zero initial length |
63 | 33 | - misspell |
| 34 | + - mnd |
64 | 35 | - nakedret |
65 | 36 | - prealloc |
| 37 | + - reassign # checks package variable reassignment |
66 | 38 | - revive |
67 | | - - rowserrcheck |
68 | | - - staticcheck |
69 | | - - stylecheck |
70 | | - - typecheck |
71 | 39 | - unconvert |
72 | 40 | - unparam |
73 | 41 | - unused |
74 | 42 | - whitespace |
75 | 43 |
|
76 | | -issues: |
77 | | - # Excluding configuration per-path, per-linter, per-text and per-source |
78 | | - exclude-rules: |
79 | | - - path: _test\.go |
80 | | - linters: |
81 | | - - mnd |
82 | | - - goconst |
83 | | - - dupl |
84 | | - - text: "Magic number: 1" |
85 | | - linters: |
86 | | - - mnd |
| 44 | + settings: |
| 45 | + depguard: |
| 46 | + rules: |
| 47 | + main: |
| 48 | + deny: |
| 49 | + - pkg: github.com/sirupsen/logrus |
| 50 | + desc: "logging is allowed only by logutils.Log" |
| 51 | + revive: |
| 52 | + rules: |
| 53 | + - name: dot-imports |
| 54 | + arguments: |
| 55 | + - allowedPackages: |
| 56 | + - "github.com/onsi/ginkgo/v2" |
| 57 | + - "github.com/onsi/gomega" |
| 58 | + dupl: |
| 59 | + threshold: 150 |
| 60 | + funlen: |
| 61 | + lines: 100 |
| 62 | + statements: 50 |
| 63 | + goconst: |
| 64 | + min-len: 2 |
| 65 | + min-occurrences: 2 |
| 66 | + gocognit: |
| 67 | + min-complexity: 30 |
| 68 | + govet: |
| 69 | + settings: |
| 70 | + printf: |
| 71 | + funcs: |
| 72 | + - (github.com/rs/zerolog/zerolog.Event).Msgf |
| 73 | + lll: |
| 74 | + line-length: 120 |
| 75 | + misspell: |
| 76 | + locale: US |
| 77 | + mnd: |
| 78 | + checks: |
| 79 | + - argument |
| 80 | + - case |
| 81 | + - condition |
| 82 | + - return |
| 83 | + prealloc: |
| 84 | + simple: true |
| 85 | + range-loops: true |
| 86 | + for-loops: false |
| 87 | + staticcheck: |
| 88 | + checks: |
| 89 | + - all |
| 90 | + - -QF1001 |
| 91 | + - -QF1003 |
| 92 | + - -QF1008 |
| 93 | + dot-import-whitelist: |
| 94 | + - github.com/onsi/ginkgo/v2 |
| 95 | + - github.com/onsi/gomega |
| 96 | + |
| 97 | + exclusions: |
| 98 | + generated: lax |
| 99 | + presets: |
| 100 | + - comments |
| 101 | + - std-error-handling |
| 102 | + paths: |
| 103 | + - vendor/ |
| 104 | + - .github/ |
| 105 | + - images/ |
| 106 | + rules: |
| 107 | + - path: _test\.go |
| 108 | + linters: |
| 109 | + - mnd |
| 110 | + - goconst |
| 111 | + - dupl |
| 112 | + - text: "Magic number: 1" |
| 113 | + linters: |
| 114 | + - mnd |
| 115 | + |
| 116 | +formatters: |
| 117 | + enable: |
| 118 | + - gofmt |
| 119 | + - goimports |
| 120 | + settings: |
| 121 | + goimports: |
| 122 | + local-prefixes: |
| 123 | + - github.com/k8snetworkplumbingwg/rdma-cni |
0 commit comments