github.com/ydb-platform/ydb-go-sdk/v3@v3.57.0/.golangci.yml (about) 1 # options for analysis running 2 run: 3 # exit code when at least one issue was found, default is 1 4 issues-exit-code: 1 5 6 # include test files or not, default is true 7 tests: true 8 9 # list of build tags, all linters use it. Default is empty list. 10 #build-tags: 11 # - mytag 12 13 # which dirs to skip: they won't be analyzed; 14 # can use regexp here: generated.*, regexp is applied on full path; 15 # default value is empty list, but next dirs are always skipped independently 16 # from this option's value: 17 # vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ 18 # skip-dirs: 19 skip-dirs-use-default: false 20 21 # which files to skip: they will be analyzed, but issues from them 22 # won't be reported. Default value is empty list, but there is 23 # no need to include all autogenerated files, we confidently recognize 24 # autogenerated files. If it's not please let us know. 25 # skip-files: 26 # - ".*\\.my\\.go$" 27 # - lib/bad.go 28 29 30 # output configuration options 31 output: 32 # colored-line-number|line-number|json|tab|checkstyle, default is "colored-line-number" 33 format: colored-line-number 34 35 # print lines of code with issue, default is true 36 print-issued-lines: true 37 38 # print linter name in the end of issue text, default is true 39 print-linter-name: true 40 41 42 # all available settings of specific linters 43 linters-settings: 44 errcheck: 45 # report about not checking of errors in types assetions: `a := b.(MyStruct)`; 46 # default is false: such cases aren't reported by default. 47 check-type-assertions: false 48 49 # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`; 50 # default is false: such cases aren't reported by default. 51 check-blank: false 52 govet: 53 # report about shadowed variables 54 check-shadowing: true 55 golint: 56 # minimal confidence for issues, default is 0.8 57 min-confidence: 0.8 58 gofmt: 59 # simplify code: gofmt with `-s` option, true by default 60 simplify: true 61 gofumpt: 62 module-path: github.com/ydb-platform/ydb-go-sdk/v3 63 goimports: 64 # put imports beginning with prefix after 3rd-party packages; 65 # it's a comma-separated list of prefixes 66 local-prefixes: github.com/ydb-platform/ydb-go-sdk/v3 67 gci: 68 sections: 69 - standard # Standard section: captures all standard packages. 70 - default # Default section: contains all imports that could not be matched to another section type. 71 - prefix(github.com/ydb-platform/ydb-go-sdk/v3) # Custom section: groups all imports with the specified Prefix. 72 skip-generated: true 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 ignore-tests: true 79 misspell: 80 # Correct spellings using locale preferences for US or UK. 81 # Default is to use a neutral variety of English. 82 # Setting locale to US will correct the British spelling of 'colour' to 'color'. 83 locale: US 84 ignore-words: 85 - cancelled 86 revive: 87 rules: 88 - name: blank-imports 89 - name: context-as-argument 90 - name: context-keys-type 91 - name: dot-imports 92 - name: error-return 93 - name: error-strings 94 - name: error-naming 95 - name: exported 96 - name: if-return 97 - name: increment-decrement 98 - name: var-naming 99 - name: var-declaration 100 - name: package-comments 101 - name: range 102 - name: receiver-naming 103 - name: time-naming 104 - name: indent-error-flow 105 - name: errorf 106 - name: empty-block 107 - name: superfluous-else 108 - name: unreachable-code 109 unparam: 110 # Inspect exported functions, default is false. Set to true if no external program/library imports your code. 111 # XXX: if you enable this setting, unparam will report a lot of false-positives in text editors: 112 # if it's called for subdir of a project it can't find external interfaces. All text editor integrations 113 # with golangci-lint call it on a directory with the changed file. 114 check-exported: false 115 gomoddirectives: 116 replace-local: true 117 replace-allow-list: 118 - xorm.io/xorm 119 gocritic: 120 disabled-checks: 121 - whyNoLint # https://github.com/go-critic/go-critic/issues/1063 122 - importShadow 123 - sloppyReassign 124 # - typeDefFirst 125 # Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint run` to see all tags and checks. 126 # See https://github.com/go-critic/go-critic#usage -> section "Tags". 127 # Default: [] 128 enabled-tags: 129 - diagnostic 130 - style 131 - performance 132 - experimental 133 - opinionated 134 # Settings passed to gocritic. 135 # The settings key is the name of a supported gocritic checker. 136 # The list of supported checkers can be find in https://go-critic.github.io/overview. 137 settings: 138 # Must be valid enabled check name. 139 captLocal: 140 # Whether to restrict checker to params only. 141 # Default: true 142 paramsOnly: false 143 elseif: 144 # Whether to skip balanced if-else pairs. 145 # Default: true 146 skipBalanced: false 147 hugeParam: 148 # Size in bytes that makes the warning trigger. 149 # Default: 80 150 sizeThreshold: 70 151 nestingReduce: 152 # Min number of statements inside a branch to trigger a warning. 153 # Default: 5 154 bodyWidth: 4 155 rangeExprCopy: 156 # Size in bytes that makes the warning trigger. 157 # Default: 512 158 sizeThreshold: 516 159 # Whether to check test functions 160 # Default: true 161 skipTestFuncs: false 162 rangeValCopy: 163 # Size in bytes that makes the warning trigger. 164 # Default: 128 165 sizeThreshold: 32 166 # Whether to check test functions. 167 # Default: true 168 skipTestFuncs: false 169 ruleguard: 170 # Enable debug to identify which 'Where' condition was rejected. 171 # The value of the parameter is the name of a function in a ruleguard file. 172 # 173 # When a rule is evaluated: 174 # If: 175 # The Match() clause is accepted; and 176 # One of the conditions in the Where() clause is rejected, 177 # Then: 178 # ruleguard prints the specific Where() condition that was rejected. 179 # 180 # The flag is passed to the ruleguard 'debug-group' argument. 181 # Default: "" 182 debug: 'emptyDecl' 183 # Deprecated, use 'failOn' param. 184 # If set to true, identical to failOn='all', otherwise failOn='' 185 failOnError: false 186 # Determines the behavior when an error occurs while parsing ruleguard files. 187 # If flag is not set, log error and skip rule files that contain an error. 188 # If flag is set, the value must be a comma-separated list of error conditions. 189 # - 'all': fail on all errors. 190 # - 'import': ruleguard rule imports a package that cannot be found. 191 # - 'dsl': gorule file does not comply with the ruleguard DSL. 192 # Default: "" 193 failOn: dsl 194 # Comma-separated list of enabled groups or skip empty to enable everything. 195 # Tags can be defined with # character prefix. 196 # Default: "<all>" 197 enable: "myGroupName,#myTagName" 198 # Comma-separated list of disabled groups or skip empty to enable everything. 199 # Tags can be defined with # character prefix. 200 # Default: "" 201 disable: "myGroupName,#myTagName" 202 tooManyResultsChecker: 203 # Maximum number of results. 204 # Default: 5 205 maxResults: 10 206 truncateCmp: 207 # Whether to skip int/uint/uintptr types. 208 # Default: true 209 skipArchDependent: false 210 underef: 211 # Whether to skip (*x).method() calls where x is a pointer receiver. 212 # Default: true 213 skipRecvDeref: false 214 unnamedResult: 215 # Whether to check exported functions. 216 # Default: false 217 checkExported: true 218 linters: 219 enable-all: true 220 disable: 221 - containedctx 222 - contextcheck 223 - cyclop 224 - depguard 225 - dupl 226 - exhaustive 227 - exhaustivestruct 228 - exhaustruct 229 - forbidigo 230 - forcetypeassert 231 - funlen 232 - gochecknoglobals 233 - gocognit 234 - godot 235 - goerr113 236 - golint 237 - gomnd 238 - ifshort 239 - interfacebloat 240 - ireturn 241 - maintidx 242 - nonamedreturns 243 - paralleltest 244 - scopelint 245 - structcheck 246 - testableexamples 247 - testpackage 248 - thelper 249 - varnamelen 250 - wrapcheck 251 - wsl 252 253 issues: 254 # List of regexps of issue texts to exclude, empty list by default. 255 # But independently from this option we use default exclude patterns, 256 # it can be disabled by `exclude-use-default: false`. To list all 257 # excluded by default patterns execute `golangci-lint run --help` 258 # exclude: 259 260 # List of regexps of issue texts to exclude. 261 # 262 # But independently of this option we use default exclude patterns, 263 # it can be disabled by `exclude-use-default: false`. 264 # To list all excluded by default patterns execute `golangci-lint run --help` 265 # 266 # Default: [] 267 exclude: 268 - "has been deprecated since Go 1.16" 269 270 # Independently from option `exclude` we use default exclude patterns, 271 # it can be disabled by this option. To list all 272 # excluded by default patterns execute `golangci-lint run --help`. 273 # Default value for this option is true. 274 exclude-use-default: true 275 276 # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. 277 max-same-issues: 0 278 279 # Show only new issues: if there are unstaged changes or untracked files, 280 # only those changes are analyzed, else only changes in HEAD~ are analyzed. 281 # It's a super-useful option for integration of golangci-lint into existing 282 # large codebase. It's not practical to fix all existing issues at the moment 283 # of integration: much better don't allow issues in new code. 284 # Default is false. 285 new: false 286 287 # Show only new issues created after git revision `REV` 288 # new-from-rev: REV 289 290 # Show only new issues created in git patch with set file path. 291 # new-from-patch: path/to/patch/file 292 exclude-rules: 293 - path: internal/xatomic/type.go 294 linters: 295 - predeclared 296 - path: _test\.go 297 linters: 298 - unused 299 - unparam 300 - gocritic 301 - path: topic/topicreader/reader_example_test.go 302 linters: 303 - staticcheck 304 - path: _test\.go 305 text: "ydb.Connection is deprecated" 306 307 # Allow underscore and capital camel case for readability 308 # Examples: Type_PRIMITIVE_TYPE_ID_UNSPECIFIED, Ydb_Discovery_V1, _voidValue 309 - linters: 310 - nosnakecase 311 text : "(?:_[a-z]+(?:[A-Z](?:[a-z\\d]+|[A-Z\\d]+))+|(?:[A-Z][a-z\\d]+|[A-Z][A-Z\\d]+)+_(?:(?:[A-Z][a-z\\d]+|[A-Z\\d][A-Z\\d]+)_?)+)"