|
| 1 | +# options for analysis running |
| 2 | +run: |
| 3 | + # default concurrency is a available CPU number |
| 4 | + concurrency: 4 |
| 5 | + |
| 6 | + # timeout for analysis, e.g. 30s, 5m, default is 1m |
| 7 | + deadline: 5m |
| 8 | + |
| 9 | + # exit code when at least one issue was found, default is 1 |
| 10 | + issues-exit-code: 1 |
| 11 | + |
| 12 | + # include test files or not, default is true |
| 13 | + tests: true |
| 14 | + |
| 15 | + # list of build tags, all linters use it. Default is empty list. |
| 16 | + #build-tags: |
| 17 | + # - mytag |
| 18 | + |
| 19 | + # which dirs to skip: they won't be analyzed; |
| 20 | + # can use regexp here: generated.*, regexp is applied on full path; |
| 21 | + # default value is empty list, but next dirs are always skipped independently |
| 22 | + # from this option's value: |
| 23 | + # vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ |
| 24 | + # skip-dirs: |
| 25 | + |
| 26 | + # which files to skip: they will be analyzed, but issues from them |
| 27 | + # won't be reported. Default value is empty list, but there is |
| 28 | + # no need to include all autogenerated files, we confidently recognize |
| 29 | + # autogenerated files. If it's not please let us know. |
| 30 | + # skip-files: |
| 31 | + # - ".*\\.my\\.go$" |
| 32 | + # - lib/bad.go |
| 33 | + |
| 34 | + |
| 35 | +# output configuration options |
| 36 | +output: |
| 37 | + # colored-line-number|line-number|json|tab|checkstyle, default is "colored-line-number" |
| 38 | + format: colored-line-number |
| 39 | + |
| 40 | + # print lines of code with issue, default is true |
| 41 | + print-issued-lines: true |
| 42 | + |
| 43 | + # print linter name in the end of issue text, default is true |
| 44 | + print-linter-name: true |
| 45 | + |
| 46 | + |
| 47 | +# all available settings of specific linters |
| 48 | +linters-settings: |
| 49 | + errcheck: |
| 50 | + # report about not checking of errors in types assetions: `a := b.(MyStruct)`; |
| 51 | + # default is false: such cases aren't reported by default. |
| 52 | + check-type-assertions: false |
| 53 | + |
| 54 | + # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`; |
| 55 | + # default is false: such cases aren't reported by default. |
| 56 | + check-blank: false |
| 57 | + govet: |
| 58 | + # report about shadowed variables |
| 59 | + check-shadowing: true |
| 60 | + fieldalignment: true |
| 61 | + golint: |
| 62 | + # minimal confidence for issues, default is 0.8 |
| 63 | + min-confidence: 0.8 |
| 64 | + gofmt: |
| 65 | + # simplify code: gofmt with `-s` option, true by default |
| 66 | + simplify: true |
| 67 | + gofumpt: |
| 68 | + module-path: slo |
| 69 | + goimports: |
| 70 | + # put imports beginning with prefix after 3rd-party packages; |
| 71 | + # it's a comma-separated list of prefixes |
| 72 | + local-prefixes: slo |
| 73 | + goconst: |
| 74 | + # minimal length of string constant, 3 by default |
| 75 | + min-len: 2 |
| 76 | + # minimal occurrences count to trigger, 3 by default |
| 77 | + min-occurrences: 2 |
| 78 | + fieldalignment: |
| 79 | + # print struct with more effective memory layout or not, false by default |
| 80 | + suggest-new: true |
| 81 | + misspell: |
| 82 | + # Correct spellings using locale preferences for US or UK. |
| 83 | + # Default is to use a neutral variety of English. |
| 84 | + # Setting locale to US will correct the British spelling of 'colour' to 'color'. |
| 85 | + locale: US |
| 86 | + ignore-words: |
| 87 | + - cancelled |
| 88 | + revive: |
| 89 | + rules: |
| 90 | + - name: blank-imports |
| 91 | + - name: context-as-argument |
| 92 | + - name: context-keys-type |
| 93 | + - name: dot-imports |
| 94 | + - name: error-return |
| 95 | + - name: error-strings |
| 96 | + - name: error-naming |
| 97 | + - name: exported |
| 98 | + - name: if-return |
| 99 | + - name: increment-decrement |
| 100 | + - name: var-naming |
| 101 | + - name: var-declaration |
| 102 | + - name: package-comments |
| 103 | + - name: range |
| 104 | + - name: receiver-naming |
| 105 | + - name: time-naming |
| 106 | + - name: indent-error-flow |
| 107 | + - name: errorf |
| 108 | + - name: empty-block |
| 109 | + - name: superfluous-else |
| 110 | + - name: unreachable-code |
| 111 | + unused: |
| 112 | + # treat code as a program (not a library) and report unused exported identifiers; default is false. |
| 113 | + # XXX: if you enable this setting, unused will report a lot of false-positives in text editors: |
| 114 | + # if it's called for subdir of a project it can't find funcs usages. All text editor integrations |
| 115 | + # with golangci-lint call it on a directory with the changed file. |
| 116 | + check-exported: false |
| 117 | + unparam: |
| 118 | + # call graph construction algorithm (cha, rta). In general, use cha for libraries, |
| 119 | + # and rta for programs with main packages. Default is cha. |
| 120 | + algo: cha |
| 121 | + |
| 122 | + # Inspect exported functions, default is false. Set to true if no external program/library imports your code. |
| 123 | + # XXX: if you enable this setting, unparam will report a lot of false-positives in text editors: |
| 124 | + # if it's called for subdir of a project it can't find external interfaces. All text editor integrations |
| 125 | + # with golangci-lint call it on a directory with the changed file. |
| 126 | + check-exported: false |
| 127 | + |
| 128 | +linters: |
| 129 | + disable-all: true |
| 130 | + enable: |
| 131 | + # - cyclop |
| 132 | + - depguard |
| 133 | + - dogsled |
| 134 | + # - dupl |
| 135 | + - errcheck |
| 136 | + - errorlint |
| 137 | + # - exhaustive |
| 138 | + # - exhaustivestruct |
| 139 | + # - forbidigo |
| 140 | + # - funlen |
| 141 | + # - gci |
| 142 | + # - gocognit |
| 143 | + - goconst |
| 144 | + - gocritic |
| 145 | + - gocyclo |
| 146 | + # - godot |
| 147 | + - godox |
| 148 | + - gofmt # On why gofmt when goimports is enabled - https://github.com/golang/go/issues/21476 |
| 149 | + - gofumpt |
| 150 | + - goheader |
| 151 | + - goimports |
| 152 | + # - gomnd |
| 153 | + # - gomoddirectives |
| 154 | + # - gomodguard |
| 155 | + - gosec |
| 156 | + - gosimple |
| 157 | + - govet |
| 158 | + - depguard |
| 159 | + # - ifshort |
| 160 | + # - ireturn |
| 161 | + - lll |
| 162 | + - makezero |
| 163 | + - misspell |
| 164 | + - ineffassign |
| 165 | + - misspell |
| 166 | + - nakedret |
| 167 | + - nestif |
| 168 | + # - nilnil |
| 169 | + # - nlreturn |
| 170 | + - nolintlint |
| 171 | + - prealloc |
| 172 | + - predeclared |
| 173 | + - rowserrcheck |
| 174 | + - revive |
| 175 | + - staticcheck |
| 176 | + - stylecheck |
| 177 | + # - tagliatelle |
| 178 | + # - testpackage |
| 179 | + # - thelper |
| 180 | + # - tenv |
| 181 | + - typecheck |
| 182 | + - unconvert |
| 183 | + - unparam |
| 184 | + - unused |
| 185 | + # - varnamelen |
| 186 | + - whitespace |
| 187 | +# - wrapcheck |
| 188 | +# - wsl |
| 189 | + |
| 190 | +issues: |
| 191 | + # List of regexps of issue texts to exclude, empty list by default. |
| 192 | + # But independently from this option we use default exclude patterns, |
| 193 | + # it can be disabled by `exclude-use-default: false`. To list all |
| 194 | + # excluded by default patterns execute `golangci-lint run --help` |
| 195 | + # exclude: |
| 196 | + |
| 197 | + # List of regexps of issue texts to exclude. |
| 198 | + # |
| 199 | + # But independently of this option we use default exclude patterns, |
| 200 | + # it can be disabled by `exclude-use-default: false`. |
| 201 | + # To list all excluded by default patterns execute `golangci-lint run --help` |
| 202 | + # |
| 203 | + # Default: [] |
| 204 | + exclude: |
| 205 | + - "has been deprecated since Go 1.16" |
| 206 | + |
| 207 | + # Independently from option `exclude` we use default exclude patterns, |
| 208 | + # it can be disabled by this option. To list all |
| 209 | + # excluded by default patterns execute `golangci-lint run --help`. |
| 210 | + # Default value for this option is true. |
| 211 | + exclude-use-default: true |
| 212 | + |
| 213 | + # Maximum issues count per one linter. Set to 0 to disable. Default is 50. |
| 214 | + max-per-linter: 0 |
| 215 | + |
| 216 | + # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. |
| 217 | + max-same-issues: 0 |
| 218 | + |
| 219 | + # Show only new issues: if there are unstaged changes or untracked files, |
| 220 | + # only those changes are analyzed, else only changes in HEAD~ are analyzed. |
| 221 | + # It's a super-useful option for integration of golangci-lint into existing |
| 222 | + # large codebase. It's not practical to fix all existing issues at the moment |
| 223 | + # of integration: much better don't allow issues in new code. |
| 224 | + # Default is false. |
| 225 | + new: false |
| 226 | + |
| 227 | + # Show only new issues created after git revision `REV` |
| 228 | + # new-from-rev: REV |
| 229 | + |
| 230 | + # Show only new issues created in git patch with set file path. |
| 231 | + # new-from-patch: path/to/patch/file |
| 232 | + exclude-rules: |
| 233 | + - path: internal/xatomic/type.go |
| 234 | + linters: |
| 235 | + - predeclared |
| 236 | + - path: _test\.go |
| 237 | + linters: |
| 238 | + - unused |
| 239 | + - unparam |
| 240 | + - path: _test\.go |
| 241 | + text: "ydb.Connection is deprecated" |
0 commit comments