|
1 | | - govet: |
2 | | - auto-fix: true |
3 | | - linters-settings: |
4 | | - enable: |
5 | | - - fieldalignment |
6 | | - check-shadowing: true |
7 | | - settings: |
8 | | - printf: |
9 | | - funcs: |
10 | | - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof |
11 | | - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf |
12 | | - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf |
13 | | - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf |
14 | | - golint: |
15 | | - min-confidence: 0 |
16 | | - gocyclo: |
17 | | - min-complexity: 10 |
18 | | - maligned: |
19 | | - suggest-new: true |
20 | | - dupl: |
21 | | - threshold: 100 |
22 | | - goconst: |
23 | | - min-len: 2 |
24 | | - min-occurrences: 2 |
25 | | - depguard: |
26 | | - list-type: blacklist |
27 | | - packages: |
28 | | - # logging is allowed only by logutils.Log, logrus |
29 | | - # is allowed to use only in logutils package |
30 | | - - github.com/sirupsen/logrus |
31 | | - misspell: |
32 | | - locale: US |
33 | | - auto-fix: true |
34 | | - lll: |
35 | | - line-length: 140 |
36 | | - goimports: |
37 | | - local-prefixes: github.com/golangci/golangci-lint |
38 | | - gocritic: |
39 | | - auto-fix: true |
40 | | - enabled-tags: |
41 | | - - performance |
42 | | - - style |
43 | | - - experimental |
44 | | - disabled-checks: |
45 | | - - wrapperFunc |
46 | | - gofumpt: |
47 | | - extra-rules: true |
48 | | - auto-fix: true |
49 | | - wsl: |
50 | | - auto-fix: true |
51 | | - stylecheck: |
52 | | - auto-fix: true |
53 | | - |
| 1 | +version: "2" |
| 2 | +run: |
| 3 | + # The default runtime timeout is 1m, which doesn't work well on Github Actions. |
| 4 | + timeout: 4m |
54 | 5 | linters: |
| 6 | + default: none |
55 | 7 | enable: |
| 8 | + - asciicheck |
| 9 | + - bodyclose |
| 10 | + - copyloopvar |
| 11 | + - cyclop |
| 12 | + - dogsled |
| 13 | + - dupl |
| 14 | + - durationcheck |
56 | 15 | - errcheck |
57 | | - - gosimple |
| 16 | + - errname |
| 17 | + - errorlint |
| 18 | + - exhaustive |
| 19 | + - forcetypeassert |
| 20 | + - gocognit |
| 21 | + - goconst |
| 22 | + - gocritic |
| 23 | + - goheader |
| 24 | + - goprintffuncname |
| 25 | + - gosec |
58 | 26 | - govet |
59 | | - - gofmt |
60 | | - - gocyclo |
| 27 | + - importas |
61 | 28 | - ineffassign |
62 | | - - stylecheck |
63 | | - - deadcode |
| 29 | + - makezero |
| 30 | + - misspell |
| 31 | + - nakedret |
| 32 | + - nestif |
| 33 | + - nilerr |
| 34 | + - noctx |
| 35 | + - nolintlint |
| 36 | + - predeclared |
| 37 | + - revive |
| 38 | + - rowserrcheck |
| 39 | + - sqlclosecheck |
64 | 40 | - staticcheck |
65 | | - - structcheck |
| 41 | + - thelper |
| 42 | + - tparallel |
| 43 | + - unconvert |
| 44 | + - unparam |
66 | 45 | - unused |
67 | | - - prealloc |
68 | | - - typecheck |
69 | | - - varcheck |
70 | | - # additional linters |
71 | | - - bodyclose |
72 | | - - gocritic |
| 46 | + - wastedassign |
73 | 47 | - whitespace |
74 | | - - wsl |
75 | | - - goimports |
76 | | - - golint |
77 | | - - misspell |
78 | | - - goerr113 |
79 | | - - noctx |
80 | | - enable-all: false |
81 | | - disable-all: true |
82 | | - |
83 | | -run: |
84 | | - skip-dirs: |
85 | | - |
86 | | - |
87 | | -issues: |
88 | | - exclude-rules: |
89 | | - - linters: |
90 | | - - gosec |
91 | | - text: "weak cryptographic primitive" |
92 | | - |
93 | | - - linters: |
94 | | - - stylecheck |
95 | | - text: "ST1016" |
96 | | - exclude: |
97 | | - # Default excludes from `golangci-lint run --help` with EXC0002 removed |
98 | | - # EXC0001 errcheck: Almost all programs ignore errors on these functions and in most cases it's ok |
99 | | - - Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked |
100 | | - # EXC0002 golint: Annoying issue about not having a comment. The rare codebase has such comments |
101 | | - # - (comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form) |
102 | | - # EXC0003 golint: False positive when tests are defined in package 'test' |
103 | | - - func name will be used as test\.Test.* by other packages, and that stutters; consider calling this |
104 | | - # EXC0004 govet: Common false positives |
105 | | - - (possible misuse of unsafe.Pointer|should have signature) |
106 | | - # EXC0005 staticcheck: Developers tend to write in C-style with an explicit 'break' in a 'switch', so it's ok to ignore |
107 | | - - ineffective break statement. Did you mean to break out of the outer loop |
108 | | - # EXC0006 gosec: Too many false-positives on 'unsafe' usage |
109 | | - - Use of unsafe calls should be audited |
110 | | - # EXC0007 gosec: Too many false-positives for parametrized shell calls |
111 | | - - Subprocess launch(ed with variable|ing should be audited) |
112 | | - # EXC0008 gosec: Duplicated errcheck checks |
113 | | - - (G104|G307) |
114 | | - # EXC0009 gosec: Too many issues in popular repos |
115 | | - - (Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less) |
116 | | - # EXC0010 gosec: False positive is triggered by 'src, err := ioutil.ReadFile(filename)' |
117 | | - - Potential file inclusion via variable |
118 | | -exclude-use-default: false |
119 | | - |
120 | | -# golangci.com configuration |
121 | | -# https://github.com/golangci/golangci/wiki/Configuration |
122 | | -#service: |
123 | | -# golangci-lint-version: 1.15.x # use the fixed version to not introduce new linters unexpectedly |
124 | | -# prepare: |
125 | | -# - echo "here I can run custom commands, but no preparation needed for this repo" |
| 48 | + settings: |
| 49 | + govet: |
| 50 | + enable: |
| 51 | + - fieldalignment |
| 52 | + settings: |
| 53 | + printf: |
| 54 | + funcs: |
| 55 | + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof |
| 56 | + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf |
| 57 | + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf |
| 58 | + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf |
| 59 | + gocyclo: |
| 60 | + min-complexity: 10 |
| 61 | + dupl: |
| 62 | + threshold: 100 |
| 63 | + goconst: |
| 64 | + min-len: 2 |
| 65 | + min-occurrences: 2 |
| 66 | + misspell: |
| 67 | + locale: US |
| 68 | + lll: |
| 69 | + line-length: 140 |
| 70 | + gocritic: |
| 71 | + enabled-tags: |
| 72 | + - performance |
| 73 | + - style |
| 74 | + - experimental |
| 75 | + disabled-checks: |
| 76 | + - wrapperFunc |
| 77 | + cyclop: |
| 78 | + max-complexity: 37 |
| 79 | + package-average: 34 |
| 80 | + errorlint: |
| 81 | + # Forcing %w in error wrapping forces authors to make errors part of their package APIs. The decision to make |
| 82 | + # an error part of a package API should be a conscious decision by the author. |
| 83 | + # Also see Hyrums Law. |
| 84 | + errorf: false |
| 85 | + asserts: false |
| 86 | + exhaustive: |
| 87 | + default-signifies-exhaustive: true |
| 88 | + gocognit: |
| 89 | + min-complexity: 98 |
| 90 | + nestif: |
| 91 | + min-complexity: 8 |
| 92 | + nolintlint: |
| 93 | + require-explanation: true |
| 94 | + require-specific: true |
| 95 | + allow-unused: false |
| 96 | + revive: |
| 97 | + severity: warning |
| 98 | + rules: |
| 99 | + - name: atomic |
| 100 | + - name: blank-imports |
| 101 | + - name: bool-literal-in-expr |
| 102 | + - name: confusing-naming |
| 103 | + - name: constant-logical-expr |
| 104 | + - name: context-as-argument |
| 105 | + - name: context-keys-type |
| 106 | + - name: deep-exit |
| 107 | + - name: defer |
| 108 | + - name: range-val-in-closure |
| 109 | + - name: range-val-address |
| 110 | + - name: dot-imports |
| 111 | + - name: error-naming |
| 112 | + - name: error-return |
| 113 | + - name: error-strings |
| 114 | + - name: errorf |
| 115 | + - name: exported |
| 116 | + - name: identical-branches |
| 117 | + - name: if-return |
| 118 | + - name: import-shadowing |
| 119 | + - name: increment-decrement |
| 120 | + - name: indent-error-flow |
| 121 | + - name: indent-error-flow |
| 122 | + - name: package-comments |
| 123 | + - name: range |
| 124 | + - name: receiver-naming |
| 125 | + - name: redefines-builtin-id |
| 126 | + - name: superfluous-else |
| 127 | + - name: struct-tag |
| 128 | + - name: time-naming |
| 129 | + - name: unexported-naming |
| 130 | + - name: unexported-return |
| 131 | + - name: unnecessary-stmt |
| 132 | + - name: unreachable-code |
| 133 | + - name: unused-parameter |
| 134 | + - name: var-declaration |
| 135 | + - name: var-naming |
| 136 | + - name: unconditional-recursion |
| 137 | + - name: waitgroup-by-value |
| 138 | + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#struct-tag |
| 139 | + - name: struct-tag |
| 140 | + arguments: |
| 141 | + - json,inline |
| 142 | + - yaml,omitzero |
| 143 | + exclusions: |
| 144 | + generated: lax |
| 145 | + presets: |
| 146 | + - comments |
| 147 | + - common-false-positives |
| 148 | + - legacy |
| 149 | + - std-error-handling |
| 150 | + paths: |
| 151 | + - examples |
| 152 | +formatters: |
| 153 | + exclusions: |
| 154 | + generated: lax |
| 155 | + paths: |
| 156 | + - examples |
0 commit comments