git.sr.ht/~pingoo/stdx@v0.0.0-20240218134121-094174641f6e/mmdb/.golangci.toml (about) 1 [run] 2 deadline = "10m" 3 tests = true 4 5 [linters] 6 disable-all = true 7 enable = [ 8 "asasalint", 9 "asciicheck", 10 "bidichk", 11 "bodyclose", 12 "containedctx", 13 "contextcheck", 14 "depguard", 15 "dupword", 16 "durationcheck", 17 "errcheck", 18 "errchkjson", 19 "errname", 20 "errorlint", 21 # "exhaustive", 22 "exportloopref", 23 "forbidigo", 24 "goconst", 25 "gocyclo", 26 "gocritic", 27 "godot", 28 "gofumpt", 29 "gomodguard", 30 "gosec", 31 "gosimple", 32 "govet", 33 "grouper", 34 "ineffassign", 35 "lll", 36 "makezero", 37 "maintidx", 38 "misspell", 39 "nakedret", 40 "nilerr", 41 "noctx", 42 "nolintlint", 43 "nosprintfhostport", 44 "predeclared", 45 "revive", 46 "rowserrcheck", 47 "sqlclosecheck", 48 "staticcheck", 49 "stylecheck", 50 "tenv", 51 "tparallel", 52 "typecheck", 53 "unconvert", 54 "unparam", 55 "unused", 56 "usestdlibvars", 57 "vetshadow", 58 "wastedassign", 59 ] 60 61 [[linters-settings.depguard.rules.main.deny]] 62 pkg = "io/ioutil" 63 desc = "Deprecated. Functions have been moved elsewhere." 64 65 [linters-settings.errcheck] 66 check-blank = true 67 # Ignoring Close so that we don't have to have a bunch of 68 # `defer func() { _ = r.Close() }()` constructs when we 69 # don't actually care about the error. 70 ignore = "Close,fmt:.*" 71 72 [linters-settings.errorlint] 73 errorf = true 74 asserts = true 75 comparison = true 76 77 [linters-settings.exhaustive] 78 default-signifies-exhaustive = true 79 80 [linters-settings.forbidigo] 81 # Forbid the following identifiers 82 forbid = [ 83 "Geoip", # use "GeoIP" 84 "^geoIP", # use "geoip" 85 "Maxmind", # use "MaxMind" 86 "^maxMind", # use "maxmind" 87 ] 88 89 [linters-settings.gocritic] 90 enabled-checks = [ 91 "appendAssign", 92 "appendCombine", 93 "argOrder", 94 "assignOp", 95 "badCall", 96 "badCond", 97 "badLock", 98 "badRegexp", 99 "badSorting", 100 "boolExprSimplify", 101 "builtinShadow", 102 "builtinShadowDecl", 103 "captLocal", 104 "caseOrder", 105 "codegenComment", 106 "commentedOutCode", 107 "commentedOutImport", 108 "commentFormatting", 109 "defaultCaseOrder", 110 "deferInLoop", 111 "deferUnlambda", 112 "deprecatedComment", 113 "docStub", 114 "dupArg", 115 "dupBranchBody", 116 "dupCase", 117 "dupImport", 118 "dupSubExpr", 119 "dynamicFmtString", 120 "elseif", 121 "emptyDecl", 122 "emptyFallthrough", 123 "emptyStringTest", 124 "equalFold", 125 "evalOrder", 126 "exitAfterDefer", 127 "exposedSyncMutex", 128 "externalErrorReassign", 129 "filepathJoin", 130 "flagDeref", 131 "flagName", 132 "hexLiteral", 133 "httpNoBody", 134 "hugeParam", 135 "ifElseChain", 136 "importShadow", 137 "indexAlloc", 138 "initClause", 139 "mapKey", 140 "methodExprCall", 141 "nestingReduce", 142 "newDeref", 143 "nilValReturn", 144 "octalLiteral", 145 "offBy1", 146 "paramTypeCombine", 147 "preferDecodeRune", 148 "preferFilepathJoin", 149 "preferFprint", 150 "preferStringWriter", 151 "preferWriteByte", 152 "ptrToRefParam", 153 "rangeExprCopy", 154 "rangeValCopy", 155 "redundantSprint", 156 "regexpMust", 157 "regexpPattern", 158 "regexpSimplify", 159 "returnAfterHttpError", 160 "ruleguard", 161 "singleCaseSwitch", 162 "sliceClear", 163 "sloppyLen", 164 "sloppyReassign", 165 "sloppyTestFuncName", 166 "sloppyTypeAssert", 167 "sortSlice", 168 "sprintfQuotedString", 169 "sqlQuery", 170 "stringsCompare", 171 "stringConcatSimplify", 172 "stringXbytes", 173 "switchTrue", 174 "syncMapLoadAndDelete", 175 "timeExprSimplify", 176 "todoCommentWithoutDetail", 177 "tooManyResultsChecker", 178 "truncateCmp", 179 "typeAssertChain", 180 "typeDefFirst", 181 "typeSwitchVar", 182 "typeUnparen", 183 "underef", 184 "unlabelStmt", 185 "unlambda", 186 # "unnamedResult", 187 "unnecessaryBlock", 188 "unnecessaryDefer", 189 "unslice", 190 "valSwap", 191 "weakCond", 192 # Covered by nolintlint 193 # "whyNoLint" 194 "wrapperFunc", 195 "yodaStyleExpr", 196 ] 197 198 [linters-settings.gofumpt] 199 extra-rules = true 200 lang-version = "1.19" 201 202 [linters-settings.gosec] 203 excludes = [ 204 # G104 - "Audit errors not checked." We use errcheck for this. 205 "G104", 206 207 # G304 - "Potential file inclusion via variable" 208 "G304", 209 210 # G306 - "Expect WriteFile permissions to be 0600 or less". 211 "G306", 212 213 # Prohibits defer (*os.File).Close, which we allow when reading from file. 214 "G307", 215 ] 216 217 [linters-settings.govet] 218 "enable-all" = true 219 disable = ["shadow"] 220 221 [linters-settings.lll] 222 line-length = 120 223 tab-width = 4 224 225 [linters-settings.nolintlint] 226 allow-leading-space = false 227 allow-unused = false 228 allow-no-explanation = ["lll", "misspell"] 229 require-explanation = true 230 require-specific = true 231 232 [linters-settings.revive] 233 ignore-generated-header = true 234 severity = "warning" 235 236 # [[linters-settings.revive.rules]] 237 # name = "add-constant" 238 239 # [[linters-settings.revive.rules]] 240 # name = "argument-limit" 241 242 [[linters-settings.revive.rules]] 243 name = "atomic" 244 245 [[linters-settings.revive.rules]] 246 name = "bare-return" 247 248 [[linters-settings.revive.rules]] 249 name = "blank-imports" 250 251 [[linters-settings.revive.rules]] 252 name = "bool-literal-in-expr" 253 254 [[linters-settings.revive.rules]] 255 name = "call-to-gc" 256 257 # [[linters-settings.revive.rules]] 258 # name = "cognitive-complexity" 259 260 [[linters-settings.revive.rules]] 261 name = "comment-spacings" 262 arguments = ["easyjson", "nolint"] 263 264 # [[linters-settings.revive.rules]] 265 # name = "confusing-naming" 266 267 # [[linters-settings.revive.rules]] 268 # name = "confusing-results" 269 270 [[linters-settings.revive.rules]] 271 name = "constant-logical-expr" 272 273 [[linters-settings.revive.rules]] 274 name = "context-as-argument" 275 276 [[linters-settings.revive.rules]] 277 name = "context-keys-type" 278 279 # [[linters-settings.revive.rules]] 280 # name = "cyclomatic" 281 282 [[linters-settings.revive.rules]] 283 name = "datarace" 284 285 # [[linters-settings.revive.rules]] 286 # name = "deep-exit" 287 288 [[linters-settings.revive.rules]] 289 name = "defer" 290 291 [[linters-settings.revive.rules]] 292 name = "dot-imports" 293 294 [[linters-settings.revive.rules]] 295 name = "duplicated-imports" 296 297 [[linters-settings.revive.rules]] 298 name = "early-return" 299 300 [[linters-settings.revive.rules]] 301 name = "empty-block" 302 303 [[linters-settings.revive.rules]] 304 name = "empty-lines" 305 306 [[linters-settings.revive.rules]] 307 name = "errorf" 308 309 [[linters-settings.revive.rules]] 310 name = "error-naming" 311 312 [[linters-settings.revive.rules]] 313 name = "error-return" 314 315 [[linters-settings.revive.rules]] 316 name = "error-strings" 317 318 [[linters-settings.revive.rules]] 319 name = "exported" 320 321 # [[linters-settings.revive.rules]] 322 # name = "file-header" 323 324 # [[linters-settings.revive.rules]] 325 # name = "flag-parameter" 326 327 # [[linters-settings.revive.rules]] 328 # name = "function-result-limit" 329 330 [[linters-settings.revive.rules]] 331 name = "get-return" 332 333 [[linters-settings.revive.rules]] 334 name = "identical-branches" 335 336 [[linters-settings.revive.rules]] 337 name = "if-return" 338 339 [[linters-settings.revive.rules]] 340 name = "imports-blacklist" 341 342 [[linters-settings.revive.rules]] 343 name = "import-shadowing" 344 345 [[linters-settings.revive.rules]] 346 name = "increment-decrement" 347 348 [[linters-settings.revive.rules]] 349 name = "indent-error-flow" 350 351 # [[linters-settings.revive.rules]] 352 # name = "line-length-limit" 353 354 # [[linters-settings.revive.rules]] 355 # name = "max-public-structs" 356 357 [[linters-settings.revive.rules]] 358 name = "modifies-parameter" 359 360 [[linters-settings.revive.rules]] 361 name = "modifies-value-receiver" 362 363 # [[linters-settings.revive.rules]] 364 # name = "nested-structs" 365 366 [[linters-settings.revive.rules]] 367 name = "optimize-operands-order" 368 369 [[linters-settings.revive.rules]] 370 name = "package-comments" 371 372 [[linters-settings.revive.rules]] 373 name = "range" 374 375 [[linters-settings.revive.rules]] 376 name = "range-val-address" 377 378 [[linters-settings.revive.rules]] 379 name = "range-val-in-closure" 380 381 [[linters-settings.revive.rules]] 382 name = "receiver-naming" 383 384 [[linters-settings.revive.rules]] 385 name = "redefines-builtin-id" 386 387 [[linters-settings.revive.rules]] 388 name = "string-of-int" 389 390 [[linters-settings.revive.rules]] 391 name = "struct-tag" 392 393 [[linters-settings.revive.rules]] 394 name = "superfluous-else" 395 396 [[linters-settings.revive.rules]] 397 name = "time-equal" 398 399 [[linters-settings.revive.rules]] 400 name = "time-naming" 401 402 [[linters-settings.revive.rules]] 403 name = "unconditional-recursion" 404 405 [[linters-settings.revive.rules]] 406 name = "unexported-naming" 407 408 [[linters-settings.revive.rules]] 409 name = "unexported-return" 410 411 # [[linters-settings.revive.rules]] 412 # name = "unhandled-error" 413 414 [[linters-settings.revive.rules]] 415 name = "unnecessary-stmt" 416 417 [[linters-settings.revive.rules]] 418 name = "unreachable-code" 419 420 [[linters-settings.revive.rules]] 421 name = "unused-parameter" 422 423 [[linters-settings.revive.rules]] 424 name = "unused-receiver" 425 426 [[linters-settings.revive.rules]] 427 name = "use-any" 428 429 [[linters-settings.revive.rules]] 430 name = "useless-break" 431 432 [[linters-settings.revive.rules]] 433 name = "var-declaration" 434 435 [[linters-settings.revive.rules]] 436 name = "var-naming" 437 438 [[linters-settings.revive.rules]] 439 name = "waitgroup-by-value" 440 441 [linters-settings.unparam] 442 check-exported = true 443 444 [issues] 445 exclude-use-default = false 446 447 [[issues.exclude-rules]] 448 linters = [ 449 "govet" 450 ] 451 path = "_test.go" 452 text = "^fieldalignment"