github.com/nalekseevs/itns-golangci-lint@v1.0.2/.golangci.next.reference.yml (about) 1 # This file contains all available configuration options 2 # with their default values (in comments). 3 # 4 # This file is not a configuration example, 5 # it contains the exhaustive configuration with explanations of the options. 6 7 # Options for analysis running. 8 run: 9 # Number of operating system threads (`GOMAXPROCS`) that can execute golangci-lint simultaneously. 10 # If it is explicitly set to 0 (i.e. not the default) then golangci-lint will automatically set the value to match Linux container CPU quota. 11 # Default: the number of logical CPUs in the machine 12 concurrency: 4 13 14 # Timeout for analysis, e.g. 30s, 5m. 15 # Default: 1m 16 timeout: 5m 17 18 # Exit code when at least one issue was found. 19 # Default: 1 20 issues-exit-code: 2 21 22 # Include test files or not. 23 # Default: true 24 tests: false 25 26 # List of build tags, all linters use it. 27 # Default: [] 28 build-tags: 29 - mytag 30 31 # If set, we pass it to "go list -mod={option}". From "go help modules": 32 # If invoked with -mod=readonly, the go command is disallowed from the implicit 33 # automatic updating of go.mod described above. Instead, it fails when any changes 34 # to go.mod are needed. This setting is most useful to check that go.mod does 35 # not need updates, such as in a continuous integration and testing system. 36 # If invoked with -mod=vendor, the go command assumes that the vendor 37 # directory holds the correct copies of dependencies and ignores 38 # the dependency descriptions in go.mod. 39 # 40 # Allowed values: readonly|vendor|mod 41 # Default: "" 42 modules-download-mode: readonly 43 44 # Allow multiple parallel golangci-lint instances running. 45 # If false, golangci-lint acquires file lock on start. 46 # Default: false 47 allow-parallel-runners: true 48 49 # Allow multiple golangci-lint instances running, but serialize them around a lock. 50 # If false, golangci-lint exits with an error if it fails to acquire file lock on start. 51 # Default: false 52 allow-serial-runners: true 53 54 # Define the Go version limit. 55 # Mainly related to generics support since go1.18. 56 # Default: use Go version from the go.mod file, fallback on the env var `GOVERSION`, fallback on 1.17 57 go: '1.19' 58 59 60 # output configuration options 61 output: 62 # The formats used to render issues. 63 # Format: `colored-line-number`, `line-number`, `json`, `colored-tab`, `tab`, `checkstyle`, `code-climate`, `junit-xml`, `github-actions`, `teamcity` 64 # Output path can be either `stdout`, `stderr` or path to the file to write to. 65 # 66 # For the CLI flag (`--out-format`), multiple formats can be specified by separating them by comma. 67 # The output can be specified for each of them by separating format name and path by colon symbol. 68 # Example: "--out-format=checkstyle:report.xml,json:stdout,colored-line-number" 69 # The CLI flag (`--out-format`) override the configuration file. 70 # 71 # Default: 72 # formats: 73 # - format: colored-line-number 74 # path: stdout 75 formats: 76 - format: json 77 path: stderr 78 - format: checkstyle 79 path: report.xml 80 - format: colored-line-number 81 82 # Print lines of code with issue. 83 # Default: true 84 print-issued-lines: false 85 86 # Print linter name in the end of issue text. 87 # Default: true 88 print-linter-name: false 89 90 # Make issues output unique by line. 91 # Default: true 92 uniq-by-line: false 93 94 # Add a prefix to the output file references. 95 # Default: "" 96 path-prefix: "" 97 98 # Sort results by the order defined in `sort-order`. 99 # Default: false 100 sort-results: true 101 102 # Order to use when sorting results. 103 # Require `sort-results` to `true`. 104 # Possible values: `file`, `linter`, and `severity`. 105 # 106 # If the severity values are inside the following list, they are ordered in this order: 107 # 1. error 108 # 2. warning 109 # 3. high 110 # 4. medium 111 # 5. low 112 # Either they are sorted alphabetically. 113 # 114 # Default: ["file"] 115 sort-order: 116 - linter 117 - severity 118 - file # filepath, line, and column. 119 120 # Show statistics per linter. 121 # Default: false 122 show-stats: true 123 124 125 # All available settings of specific linters. 126 linters-settings: 127 asasalint: 128 # To specify a set of function names to exclude. 129 # The values are merged with the builtin exclusions. 130 # The builtin exclusions can be disabled by setting `use-builtin-exclusions` to `false`. 131 # Default: ["^(fmt|log|logger|t|)\.(Print|Fprint|Sprint|Fatal|Panic|Error|Warn|Warning|Info|Debug|Log)(|f|ln)$"] 132 exclude: 133 - Append 134 - \.Wrapf 135 # To enable/disable the asasalint builtin exclusions of function names. 136 # See the default value of `exclude` to get the builtin exclusions. 137 # Default: true 138 use-builtin-exclusions: false 139 # Ignore *_test.go files. 140 # Default: false 141 ignore-test: true 142 143 bidichk: 144 # The following configurations check for all mentioned invisible unicode runes. 145 # All runes are enabled by default. 146 left-to-right-embedding: false 147 right-to-left-embedding: false 148 pop-directional-formatting: false 149 left-to-right-override: false 150 right-to-left-override: false 151 left-to-right-isolate: false 152 right-to-left-isolate: false 153 first-strong-isolate: false 154 pop-directional-isolate: false 155 156 copyloopvar: 157 # Check all assigning the loop variable to another variable. 158 # Default: false 159 check-alias: true 160 161 cyclop: 162 # The maximal code complexity to report. 163 # Default: 10 164 max-complexity: 10 165 # The maximal average package complexity. 166 # If it's higher than 0.0 (float) the check is enabled 167 # Default: 0.0 168 package-average: 0.5 169 # Should ignore tests. 170 # Default: false 171 skip-tests: true 172 173 decorder: 174 # Required order of `type`, `const`, `var` and `func` declarations inside a file. 175 # Default: types before constants before variables before functions. 176 dec-order: 177 - type 178 - const 179 - var 180 - func 181 182 # If true, underscore vars (vars with "_" as the name) will be ignored at all checks 183 # Default: false (underscore vars are not ignored) 184 ignore-underscore-vars: false 185 186 # If true, order of declarations is not checked at all. 187 # Default: true (disabled) 188 disable-dec-order-check: false 189 190 # If true, `init` func can be anywhere in file (does not have to be declared before all other functions). 191 # Default: true (disabled) 192 disable-init-func-first-check: false 193 194 # If true, multiple global `type`, `const` and `var` declarations are allowed. 195 # Default: true (disabled) 196 disable-dec-num-check: false 197 198 # If true, type declarations will be ignored for dec num check 199 # Default: false (type statements are not ignored) 200 disable-type-dec-num-check: false 201 202 # If true, const declarations will be ignored for dec num check 203 # Default: false (const statements are not ignored) 204 disable-const-dec-num-check: false 205 206 # If true, var declarations will be ignored for dec num check 207 # Default: false (var statements are not ignored) 208 disable-var-dec-num-check: false 209 210 depguard: 211 # Rules to apply. 212 # 213 # Variables: 214 # - File Variables 215 # you can still use and exclamation mark ! in front of a variable to say not to use it. 216 # Example !$test will match any file that is not a go test file. 217 # 218 # `$all` - matches all go files 219 # `$test` - matches all go test files 220 # 221 # - Package Variables 222 # 223 # `$gostd` - matches all of go's standard library (Pulled from `GOROOT`) 224 # 225 # Default: Only allow $gostd in all files. 226 rules: 227 # Name of a rule. 228 main: 229 # Used to determine the package matching priority. 230 # There are three different modes: `original`, `strict`, and `lax`. 231 # Default: "original" 232 list-mode: lax 233 # List of file globs that will match this list of settings to compare against. 234 # Default: $all 235 files: 236 - "!**/*_a _file.go" 237 # List of allowed packages. 238 allow: 239 - $gostd 240 - github.com/OpenPeeDeeP 241 # Packages that are not allowed where the value is a suggestion. 242 deny: 243 - pkg: "github.com/sirupsen/logrus" 244 desc: not allowed 245 - pkg: "github.com/pkg/errors" 246 desc: Should be replaced by standard lib errors package 247 248 dogsled: 249 # Checks assignments with too many blank identifiers. 250 # Default: 2 251 max-blank-identifiers: 3 252 253 dupl: 254 # Tokens count to trigger issue. 255 # Default: 150 256 threshold: 100 257 258 dupword: 259 # Keywords for detecting duplicate words. 260 # If this list is not empty, only the words defined in this list will be detected. 261 # Default: [] 262 keywords: 263 - "the" 264 - "and" 265 - "a" 266 # Keywords used to ignore detection. 267 # Default: [] 268 ignore: 269 - "0C0C" 270 271 errcheck: 272 # Report about not checking of errors in type assertions: `a := b.(MyStruct)`. 273 # Such cases aren't reported by default. 274 # Default: false 275 check-type-assertions: true 276 277 # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`. 278 # Such cases aren't reported by default. 279 # Default: false 280 check-blank: true 281 282 # To disable the errcheck built-in exclude list. 283 # See `-excludeonly` option in https://github.com/kisielk/errcheck#excluding-functions for details. 284 # Default: false 285 disable-default-exclusions: true 286 287 # List of functions to exclude from checking, where each entry is a single function to exclude. 288 # See https://github.com/kisielk/errcheck#excluding-functions for details. 289 exclude-functions: 290 - io/ioutil.ReadFile 291 - io.Copy(*bytes.Buffer) 292 - io.Copy(os.Stdout) 293 294 errchkjson: 295 # With check-error-free-encoding set to true, errchkjson does warn about errors 296 # from json encoding functions that are safe to be ignored, 297 # because they are not possible to happen. 298 # 299 # if check-error-free-encoding is set to true and errcheck linter is enabled, 300 # it is recommended to add the following exceptions to prevent from false positives: 301 # 302 # linters-settings: 303 # errcheck: 304 # exclude-functions: 305 # - encoding/json.Marshal 306 # - encoding/json.MarshalIndent 307 # 308 # Default: false 309 check-error-free-encoding: true 310 311 # Issue on struct encoding that doesn't have exported fields. 312 # Default: false 313 report-no-exported: false 314 315 errorlint: 316 # Check whether fmt.Errorf uses the %w verb for formatting errors. 317 # See the https://github.com/polyfloyd/go-errorlint for caveats. 318 # Default: true 319 errorf: false 320 # Permit more than 1 %w verb, valid per Go 1.20 (Requires errorf:true) 321 # Default: true 322 errorf-multi: false 323 # Check for plain type assertions and type switches. 324 # Default: true 325 asserts: false 326 # Check for plain error comparisons. 327 # Default: true 328 comparison: false 329 # Allowed errors. 330 # Default: [] 331 allowed-errors: 332 - err: "io.EOF" 333 fun: "example.com/pkg.Read" 334 # Allowed error "wildcards". 335 # Default: [] 336 allowed-errors-wildcard: 337 - err: "example.com/pkg.ErrMagic" 338 fun: "example.com/pkg.Magic" 339 340 exhaustive: 341 # Program elements to check for exhaustiveness. 342 # Default: [ switch ] 343 check: 344 - switch 345 - map 346 # Check switch statements in generated files also. 347 # Default: false 348 check-generated: true 349 # Presence of "default" case in switch statements satisfies exhaustiveness, 350 # even if all enum members are not listed. 351 # Default: false 352 default-signifies-exhaustive: true 353 # Enum members matching the supplied regex do not have to be listed in 354 # switch statements to satisfy exhaustiveness. 355 # Default: "" 356 ignore-enum-members: "Example.+" 357 # Enum types matching the supplied regex do not have to be listed in 358 # switch statements to satisfy exhaustiveness. 359 # Default: "" 360 ignore-enum-types: "Example.+" 361 # Consider enums only in package scopes, not in inner scopes. 362 # Default: false 363 package-scope-only: true 364 # Only run exhaustive check on switches with "//exhaustive:enforce" comment. 365 # Default: false 366 explicit-exhaustive-switch: true 367 # Only run exhaustive check on map literals with "//exhaustive:enforce" comment. 368 # Default: false 369 explicit-exhaustive-map: true 370 # Switch statement requires default case even if exhaustive. 371 # Default: false 372 default-case-required: true 373 374 exhaustruct: 375 # List of regular expressions to match struct packages and their names. 376 # Regular expressions must match complete canonical struct package/name/structname. 377 # If this list is empty, all structs are tested. 378 # Default: [] 379 include: 380 - '.+\.Test' 381 - 'example\.com/package\.ExampleStruct[\d]{1,2}' 382 # List of regular expressions to exclude struct packages and their names from checks. 383 # Regular expressions must match complete canonical struct package/name/structname. 384 # Default: [] 385 exclude: 386 - '.+/cobra\.Command$' 387 388 forbidigo: 389 # Forbid the following identifiers (list of regexp). 390 # Default: ["^(fmt\\.Print(|f|ln)|print|println)$"] 391 forbid: 392 # Builtin function: 393 - ^print.*$ 394 # Optional message that gets included in error reports. 395 - p: ^fmt\.Print.*$ 396 msg: Do not commit print statements. 397 # Alternatively, put messages at the end of the regex, surrounded by `(# )?` 398 # Escape any special characters. Those messages get included in error reports. 399 - 'fmt\.Print.*(# Do not commit print statements\.)?' 400 # Forbid spew Dump, whether it is called as function or method. 401 # Depends on analyze-types below. 402 - ^spew\.(ConfigState\.)?Dump$ 403 # The package name might be ambiguous. 404 # The full import path can be used as additional criteria. 405 # Depends on analyze-types below. 406 - p: ^v1.Dump$ 407 pkg: ^example.com/pkg/api/v1$ 408 # Exclude godoc examples from forbidigo checks. 409 # Default: true 410 exclude-godoc-examples: false 411 # Instead of matching the literal source code, 412 # use type information to replace expressions with strings that contain the package name 413 # and (for methods and fields) the type name. 414 # This makes it possible to handle import renaming and forbid struct fields and methods. 415 # Default: false 416 analyze-types: true 417 418 funlen: 419 # Checks the number of lines in a function. 420 # If lower than 0, disable the check. 421 # Default: 60 422 lines: -1 423 # Checks the number of statements in a function. 424 # If lower than 0, disable the check. 425 # Default: 40 426 statements: -1 427 # Ignore comments when counting lines. 428 # Default false 429 ignore-comments: true 430 431 gci: 432 # Section configuration to compare against. 433 # Section names are case-insensitive and may contain parameters in (). 434 # The default order of sections is `standard > default > custom > blank > dot > alias > localmodule`, 435 # If `custom-order` is `true`, it follows the order of `sections` option. 436 # Default: ["standard", "default"] 437 sections: 438 - standard # Standard section: captures all standard packages. 439 - default # Default section: contains all imports that could not be matched to another section type. 440 - prefix(github.com/org/project) # Custom section: groups all imports with the specified Prefix. 441 - blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled. 442 - dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled. 443 - alias # Alias section: contains all alias imports. This section is not present unless explicitly enabled. 444 - localmodule # Local module section: contains all local packages. This section is not present unless explicitly enabled. 445 446 # Skip generated files. 447 # Default: true 448 skip-generated: false 449 450 # Enable custom order of sections. 451 # If `true`, make the section order the same as the order of `sections`. 452 # Default: false 453 custom-order: true 454 455 ginkgolinter: 456 # Suppress the wrong length assertion warning. 457 # Default: false 458 suppress-len-assertion: true 459 460 # Suppress the wrong nil assertion warning. 461 # Default: false 462 suppress-nil-assertion: true 463 464 # Suppress the wrong error assertion warning. 465 # Default: false 466 suppress-err-assertion: true 467 468 # Suppress the wrong comparison assertion warning. 469 # Default: false 470 suppress-compare-assertion: true 471 472 # Suppress the function all in async assertion warning. 473 # Default: false 474 suppress-async-assertion: true 475 476 # Suppress warning for comparing values from different types, like `int32` and `uint32` 477 # Default: false 478 suppress-type-compare-assertion: true 479 480 # Trigger warning for ginkgo focus containers like `FDescribe`, `FContext`, `FWhen` or `FIt` 481 # Default: false 482 forbid-focus-container: true 483 484 # Don't trigger warnings for HaveLen(0) 485 # Default: false 486 allow-havelen-zero: true 487 488 # Force using `Expect` with `To`, `ToNot` or `NotTo`. 489 # Reject using `Expect` with `Should` or `ShouldNot`. 490 # Default: false 491 force-expect-to: true 492 493 # Best effort validation of async intervals (timeout and polling). 494 # Ignored the suppress-async-assertion is true. 495 # Default: false 496 validate-async-intervals: true 497 498 # Trigger a warning for variable assignments in ginkgo containers like `Describe`, `Context` and `When`, instead of in `BeforeEach()`. 499 # Default: false 500 forbid-spec-pollution: true 501 502 gocognit: 503 # Minimal code complexity to report. 504 # Default: 30 (but we recommend 10-20) 505 min-complexity: 10 506 507 goconst: 508 # Minimal length of string constant. 509 # Default: 3 510 min-len: 2 511 # Minimum occurrences of constant string count to trigger issue. 512 # Default: 3 513 min-occurrences: 2 514 # Ignore test files. 515 # Default: false 516 ignore-tests: true 517 # Look for existing constants matching the values. 518 # Default: true 519 match-constant: false 520 # Search also for duplicated numbers. 521 # Default: false 522 numbers: true 523 # Minimum value, only works with goconst.numbers 524 # Default: 3 525 min: 2 526 # Maximum value, only works with goconst.numbers 527 # Default: 3 528 max: 2 529 # Ignore when constant is not used as function argument. 530 # Default: true 531 ignore-calls: false 532 # Exclude strings matching the given regular expression. 533 # Default: "" 534 ignore-strings: 'foo.+' 535 536 gocritic: 537 # Disable all checks. 538 # Default: false 539 disable-all: true 540 # Which checks should be enabled in addition to default checks; can't be combined with 'disabled-checks'. 541 # By default, list of stable checks is used (https://go-critic.github.io/overview#checks-overview): 542 # appendAssign, argOrder, assignOp, badCall, badCond, captLocal, caseOrder, codegenComment, commentFormatting, 543 # defaultCaseOrder, deprecatedComment, dupArg, dupBranchBody, dupCase, dupSubExpr, elseif, exitAfterDefer, 544 # flagDeref, flagName, ifElseChain, mapKey, newDeref, offBy1, regexpMust, singleCaseSwitch, sloppyLen, 545 # sloppyTypeAssert, switchTrue, typeSwitchVar, underef, unlambda, unslice, valSwap, wrapperFunc 546 # To see which checks are enabled run `GL_DEBUG=gocritic golangci-lint run --enable=gocritic`. 547 enabled-checks: 548 - nestingReduce 549 - unnamedResult 550 - ruleguard 551 - truncateCmp 552 553 # Enable all checks. 554 # Default: false 555 enable-all: true 556 # Which checks should be disabled; can't be combined with 'enabled-checks'. 557 # Default: [] 558 disabled-checks: 559 - regexpMust 560 561 # Enable multiple checks by tags in addition to default checks. 562 # Run `GL_DEBUG=gocritic golangci-lint run --enable=gocritic` to see all tags and checks. 563 # See https://github.com/go-critic/go-critic#usage -> section "Tags". 564 # Default: [] 565 enabled-tags: 566 - diagnostic 567 - style 568 - performance 569 - experimental 570 - opinionated 571 disabled-tags: 572 - diagnostic 573 - style 574 - performance 575 - experimental 576 - opinionated 577 578 # Settings passed to gocritic. 579 # The settings key is the name of a supported gocritic checker. 580 # The list of supported checkers can be find in https://go-critic.github.io/overview. 581 settings: 582 # Must be valid enabled check name. 583 captLocal: 584 # Whether to restrict checker to params only. 585 # Default: true 586 paramsOnly: false 587 commentedOutCode: 588 # Min length of the comment that triggers a warning. 589 # Default: 15 590 minLength: 50 591 elseif: 592 # Whether to skip balanced if-else pairs. 593 # Default: true 594 skipBalanced: false 595 hugeParam: 596 # Size in bytes that makes the warning trigger. 597 # Default: 80 598 sizeThreshold: 70 599 ifElseChain: 600 # Min number of if-else blocks that makes the warning trigger. 601 # Default: 2 602 minThreshold: 4 603 nestingReduce: 604 # Min number of statements inside a branch to trigger a warning. 605 # Default: 5 606 bodyWidth: 4 607 rangeExprCopy: 608 # Size in bytes that makes the warning trigger. 609 # Default: 512 610 sizeThreshold: 516 611 # Whether to check test functions 612 # Default: true 613 skipTestFuncs: false 614 rangeValCopy: 615 # Size in bytes that makes the warning trigger. 616 # Default: 128 617 sizeThreshold: 32 618 # Whether to check test functions. 619 # Default: true 620 skipTestFuncs: false 621 ruleguard: 622 # Enable debug to identify which 'Where' condition was rejected. 623 # The value of the parameter is the name of a function in a ruleguard file. 624 # 625 # When a rule is evaluated: 626 # If: 627 # The Match() clause is accepted; and 628 # One of the conditions in the Where() clause is rejected, 629 # Then: 630 # ruleguard prints the specific Where() condition that was rejected. 631 # 632 # The option is passed to the ruleguard 'debug-group' argument. 633 # Default: "" 634 debug: 'emptyDecl' 635 # Determines the behavior when an error occurs while parsing ruleguard files. 636 # If flag is not set, log error and skip rule files that contain an error. 637 # If flag is set, the value must be a comma-separated list of error conditions. 638 # - 'all': fail on all errors. 639 # - 'import': ruleguard rule imports a package that cannot be found. 640 # - 'dsl': gorule file does not comply with the ruleguard DSL. 641 # Default: "" 642 failOn: dsl,import 643 # Comma-separated list of file paths containing ruleguard rules. 644 # If a path is relative, it is relative to the directory where the golangci-lint command is executed. 645 # The special '${configDir}' variable is substituted with the absolute directory containing the golangci config file. 646 # Glob patterns such as 'rules-*.go' may be specified. 647 # Default: "" 648 rules: '${configDir}/ruleguard/rules-*.go,${configDir}/myrule1.go' 649 # Comma-separated list of enabled groups or skip empty to enable everything. 650 # Tags can be defined with # character prefix. 651 # Default: "<all>" 652 enable: "myGroupName,#myTagName" 653 # Comma-separated list of disabled groups or skip empty to enable everything. 654 # Tags can be defined with # character prefix. 655 # Default: "" 656 disable: "myGroupName,#myTagName" 657 tooManyResultsChecker: 658 # Maximum number of results. 659 # Default: 5 660 maxResults: 10 661 truncateCmp: 662 # Whether to skip int/uint/uintptr types. 663 # Default: true 664 skipArchDependent: false 665 underef: 666 # Whether to skip (*x).method() calls where x is a pointer receiver. 667 # Default: true 668 skipRecvDeref: false 669 unnamedResult: 670 # Whether to check exported functions. 671 # Default: false 672 checkExported: true 673 674 gocyclo: 675 # Minimal code complexity to report. 676 # Default: 30 (but we recommend 10-20) 677 min-complexity: 10 678 679 godot: 680 # Comments to be checked: `declarations`, `toplevel`, or `all`. 681 # Default: declarations 682 scope: toplevel 683 # List of regexps for excluding particular comment lines from check. 684 # Default: [] 685 exclude: 686 # Exclude todo and fixme comments. 687 - "^fixme:" 688 - "^todo:" 689 # Check that each sentence ends with a period. 690 # Default: true 691 period: false 692 # Check that each sentence starts with a capital letter. 693 # Default: false 694 capital: true 695 696 godox: 697 # Report any comments starting with keywords, this is useful for TODO or FIXME comments that 698 # might be left in the code accidentally and should be resolved before merging. 699 # Default: ["TODO", "BUG", "FIXME"] 700 keywords: 701 - NOTE 702 - OPTIMIZE # marks code that should be optimized before merging 703 - HACK # marks hack-around that should be removed before merging 704 705 gofmt: 706 # Simplify code: gofmt with `-s` option. 707 # Default: true 708 simplify: false 709 # Apply the rewrite rules to the source before reformatting. 710 # https://pkg.go.dev/cmd/gofmt 711 # Default: [] 712 rewrite-rules: 713 - pattern: 'interface{}' 714 replacement: 'any' 715 - pattern: 'a[b:len(a)]' 716 replacement: 'a[b:]' 717 718 gofumpt: 719 # Module path which contains the source code being formatted. 720 # Default: "" 721 module-path: github.com/org/project 722 723 # Choose whether to use the extra rules. 724 # Default: false 725 extra-rules: true 726 727 goheader: 728 # Supports two types 'const` and `regexp`. 729 # Values can be used recursively. 730 # Default: {} 731 values: 732 const: 733 # Define here const type values in format k:v. 734 # For example: 735 COMPANY: MY COMPANY 736 regexp: 737 # Define here regexp type values. 738 # for example: 739 AUTHOR: .*@mycompany\.com 740 # The template use for checking. 741 # Default: "" 742 template: |- 743 # Put here copyright header template for source code files 744 # For example: 745 # Note: {{ YEAR }} is a builtin value that returns the year relative to the current machine time. 746 # 747 # {{ AUTHOR }} {{ COMPANY }} {{ YEAR }} 748 # SPDX-License-Identifier: Apache-2.0 749 750 # Licensed under the Apache License, Version 2.0 (the "License"); 751 # you may not use this file except in compliance with the License. 752 # You may obtain a copy of the License at: 753 754 # http://www.apache.org/licenses/LICENSE-2.0 755 756 # Unless required by applicable law or agreed to in writing, software 757 # distributed under the License is distributed on an "AS IS" BASIS, 758 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 759 # See the License for the specific language governing permissions and 760 # limitations under the License. 761 # As alternative of directive 'template', you may put the path to file with the template source. 762 # Useful if you need to load the template from a specific file. 763 # Default: "" 764 template-path: /path/to/my/template.tmpl 765 766 goimports: 767 # A comma-separated list of prefixes, which, if set, checks import paths 768 # with the given prefixes are grouped after 3rd-party packages. 769 # Default: "" 770 local-prefixes: github.com/org/project 771 772 gomoddirectives: 773 # Allow local `replace` directives. 774 # Default: false 775 replace-local: false 776 # List of allowed `replace` directives. 777 # Default: [] 778 replace-allow-list: 779 - launchpad.net/gocheck 780 # Allow to not explain why the version has been retracted in the `retract` directives. 781 # Default: false 782 retract-allow-no-explanation: false 783 # Forbid the use of the `exclude` directives. 784 # Default: false 785 exclude-forbidden: false 786 787 gomodguard: 788 allowed: 789 # List of allowed modules. 790 # Default: [] 791 modules: 792 - gopkg.in/yaml.v2 793 # List of allowed module domains. 794 # Default: [] 795 domains: 796 - golang.org 797 blocked: 798 # List of blocked modules. 799 # Default: [] 800 modules: 801 # Blocked module. 802 - github.com/uudashr/go-module: 803 # Recommended modules that should be used instead. (Optional) 804 recommendations: 805 - golang.org/x/mod 806 # Reason why the recommended module should be used. (Optional) 807 reason: "`mod` is the official go.mod parser library." 808 # List of blocked module version constraints. 809 # Default: [] 810 versions: 811 # Blocked module with version constraint. 812 - github.com/mitchellh/go-homedir: 813 # Version constraint, see https://github.com/Masterminds/semver#basic-comparisons. 814 version: "< 1.1.0" 815 # Reason why the version constraint exists. (Optional) 816 reason: "testing if blocked version constraint works." 817 # Set to true to raise lint issues for packages that are loaded from a local path via replace directive. 818 # Default: false 819 local_replace_directives: false 820 821 gosimple: 822 # Sxxxx checks in https://staticcheck.io/docs/configuration/options/#checks 823 # Default: ["*"] 824 checks: [ "all" ] 825 826 gosec: 827 # To select a subset of rules to run. 828 # Available rules: https://github.com/securego/gosec#available-rules 829 # Default: [] - means include all rules 830 includes: 831 - G101 # Look for hard coded credentials 832 - G102 # Bind to all interfaces 833 - G103 # Audit the use of unsafe block 834 - G104 # Audit errors not checked 835 - G106 # Audit the use of ssh.InsecureIgnoreHostKey 836 - G107 # Url provided to HTTP request as taint input 837 - G108 # Profiling endpoint automatically exposed on /debug/pprof 838 - G109 # Potential Integer overflow made by strconv.Atoi result conversion to int16/32 839 - G110 # Potential DoS vulnerability via decompression bomb 840 - G111 # Potential directory traversal 841 - G112 # Potential slowloris attack 842 - G113 # Usage of Rat.SetString in math/big with an overflow (CVE-2022-23772) 843 - G114 # Use of net/http serve function that has no support for setting timeouts 844 - G201 # SQL query construction using format string 845 - G202 # SQL query construction using string concatenation 846 - G203 # Use of unescaped data in HTML templates 847 - G204 # Audit use of command execution 848 - G301 # Poor file permissions used when creating a directory 849 - G302 # Poor file permissions used with chmod 850 - G303 # Creating tempfile using a predictable path 851 - G304 # File path provided as taint input 852 - G305 # File traversal when extracting zip/tar archive 853 - G306 # Poor file permissions used when writing to a new file 854 - G307 # Poor file permissions used when creating a file with os.Create 855 - G401 # Detect the usage of DES, RC4, MD5 or SHA1 856 - G402 # Look for bad TLS connection settings 857 - G403 # Ensure minimum RSA key length of 2048 bits 858 - G404 # Insecure random number source (rand) 859 - G501 # Import blocklist: crypto/md5 860 - G502 # Import blocklist: crypto/des 861 - G503 # Import blocklist: crypto/rc4 862 - G504 # Import blocklist: net/http/cgi 863 - G505 # Import blocklist: crypto/sha1 864 - G601 # Implicit memory aliasing of items from a range statement 865 - G602 # Slice access out of bounds 866 867 # To specify a set of rules to explicitly exclude. 868 # Available rules: https://github.com/securego/gosec#available-rules 869 # Default: [] 870 excludes: 871 - G101 # Look for hard coded credentials 872 - G102 # Bind to all interfaces 873 - G103 # Audit the use of unsafe block 874 - G104 # Audit errors not checked 875 - G106 # Audit the use of ssh.InsecureIgnoreHostKey 876 - G107 # Url provided to HTTP request as taint input 877 - G108 # Profiling endpoint automatically exposed on /debug/pprof 878 - G109 # Potential Integer overflow made by strconv.Atoi result conversion to int16/32 879 - G110 # Potential DoS vulnerability via decompression bomb 880 - G111 # Potential directory traversal 881 - G112 # Potential slowloris attack 882 - G113 # Usage of Rat.SetString in math/big with an overflow (CVE-2022-23772) 883 - G114 # Use of net/http serve function that has no support for setting timeouts 884 - G201 # SQL query construction using format string 885 - G202 # SQL query construction using string concatenation 886 - G203 # Use of unescaped data in HTML templates 887 - G204 # Audit use of command execution 888 - G301 # Poor file permissions used when creating a directory 889 - G302 # Poor file permissions used with chmod 890 - G303 # Creating tempfile using a predictable path 891 - G304 # File path provided as taint input 892 - G305 # File traversal when extracting zip/tar archive 893 - G306 # Poor file permissions used when writing to a new file 894 - G307 # Poor file permissions used when creating a file with os.Create 895 - G401 # Detect the usage of DES, RC4, MD5 or SHA1 896 - G402 # Look for bad TLS connection settings 897 - G403 # Ensure minimum RSA key length of 2048 bits 898 - G404 # Insecure random number source (rand) 899 - G501 # Import blocklist: crypto/md5 900 - G502 # Import blocklist: crypto/des 901 - G503 # Import blocklist: crypto/rc4 902 - G504 # Import blocklist: net/http/cgi 903 - G505 # Import blocklist: crypto/sha1 904 - G601 # Implicit memory aliasing of items from a range statement 905 - G602 # Slice access out of bounds 906 907 # Exclude generated files 908 # Default: false 909 exclude-generated: true 910 911 # Filter out the issues with a lower severity than the given value. 912 # Valid options are: low, medium, high. 913 # Default: low 914 severity: medium 915 916 # Filter out the issues with a lower confidence than the given value. 917 # Valid options are: low, medium, high. 918 # Default: low 919 confidence: medium 920 921 # Concurrency value. 922 # Default: the number of logical CPUs usable by the current process. 923 concurrency: 12 924 925 # To specify the configuration of rules. 926 config: 927 # Globals are applicable to all rules. 928 global: 929 # If true, ignore #nosec in comments (and an alternative as well). 930 # Default: false 931 nosec: true 932 # Add an alternative comment prefix to #nosec (both will work at the same time). 933 # Default: "" 934 "#nosec": "#my-custom-nosec" 935 # Define whether nosec issues are counted as finding or not. 936 # Default: false 937 show-ignored: true 938 # Audit mode enables addition checks that for normal code analysis might be too nosy. 939 # Default: false 940 audit: true 941 G101: 942 # Regexp pattern for variables and constants to find. 943 # Default: "(?i)passwd|pass|password|pwd|secret|token|pw|apiKey|bearer|cred" 944 pattern: "(?i)example" 945 # If true, complain about all cases (even with low entropy). 946 # Default: false 947 ignore_entropy: false 948 # Maximum allowed entropy of the string. 949 # Default: "80.0" 950 entropy_threshold: "80.0" 951 # Maximum allowed value of entropy/string length. 952 # Is taken into account if entropy >= entropy_threshold/2. 953 # Default: "3.0" 954 per_char_threshold: "3.0" 955 # Calculate entropy for first N chars of the string. 956 # Default: "16" 957 truncate: "32" 958 # Additional functions to ignore while checking unhandled errors. 959 # Following functions always ignored: 960 # bytes.Buffer: 961 # - Write 962 # - WriteByte 963 # - WriteRune 964 # - WriteString 965 # fmt: 966 # - Print 967 # - Printf 968 # - Println 969 # - Fprint 970 # - Fprintf 971 # - Fprintln 972 # strings.Builder: 973 # - Write 974 # - WriteByte 975 # - WriteRune 976 # - WriteString 977 # io.PipeWriter: 978 # - CloseWithError 979 # hash.Hash: 980 # - Write 981 # os: 982 # - Unsetenv 983 # Default: {} 984 G104: 985 fmt: 986 - Fscanf 987 G111: 988 # Regexp pattern to find potential directory traversal. 989 # Default: "http\\.Dir\\(\"\\/\"\\)|http\\.Dir\\('\\/'\\)" 990 pattern: "custom\\.Dir\\(\\)" 991 # Maximum allowed permissions mode for os.Mkdir and os.MkdirAll 992 # Default: "0750" 993 G301: "0750" 994 # Maximum allowed permissions mode for os.OpenFile and os.Chmod 995 # Default: "0600" 996 G302: "0600" 997 # Maximum allowed permissions mode for os.WriteFile and ioutil.WriteFile 998 # Default: "0600" 999 G306: "0600" 1000 1001 gosmopolitan: 1002 # Allow and ignore `time.Local` usages. 1003 # 1004 # Default: false 1005 allow-time-local: true 1006 # List of fully qualified names in the `full/pkg/path.name` form, to act as "i18n escape hatches". 1007 # String literals inside call-like expressions to, or struct literals of those names, 1008 # are exempt from the writing system check. 1009 # 1010 # Default: [] 1011 escape-hatches: 1012 - 'github.com/nicksnyder/go-i18n/v2/i18n.Message' 1013 - 'example.com/your/project/i18n/markers.Raw' 1014 - 'example.com/your/project/i18n/markers.OK' 1015 - 'example.com/your/project/i18n/markers.TODO' 1016 - 'command-line-arguments.Simple' 1017 # Ignore test files. 1018 # 1019 # Default: true 1020 ignore-tests: false 1021 # List of Unicode scripts to watch for any usage in string literals. 1022 # https://pkg.go.dev/unicode#pkg-variables 1023 # 1024 # Default: ["Han"] 1025 watch-for-scripts: 1026 - Devanagari 1027 - Han 1028 - Hangul 1029 - Hiragana 1030 - Katakana 1031 1032 govet: 1033 # Disable all analyzers. 1034 # Default: false 1035 disable-all: true 1036 # Enable analyzers by name. 1037 # (in addition to default: 1038 # appends, asmdecl, assign, atomic, bools, buildtag, cgocall, composites, copylocks, defers, directive, errorsas, 1039 # framepointer, httpresponse, ifaceassert, loopclosure, lostcancel, nilfunc, printf, shift, sigchanyzer, slog, 1040 # stdmethods, stringintconv, structtag, testinggoroutine, tests, timeformat, unmarshal, unreachable, unsafeptr, 1041 # unusedresult 1042 # ). 1043 # Run `GL_DEBUG=govet golangci-lint run --enable=govet` to see default, all available analyzers, and enabled analyzers. 1044 # Default: [] 1045 enable: 1046 - appends 1047 - asmdecl 1048 - assign 1049 - atomic 1050 - atomicalign 1051 - bools 1052 - buildtag 1053 - cgocall 1054 - composites 1055 - copylocks 1056 - deepequalerrors 1057 - defers 1058 - directive 1059 - errorsas 1060 - fieldalignment 1061 - findcall 1062 - framepointer 1063 - httpresponse 1064 - ifaceassert 1065 - loopclosure 1066 - lostcancel 1067 - nilfunc 1068 - nilness 1069 - printf 1070 - reflectvaluecompare 1071 - shadow 1072 - shift 1073 - sigchanyzer 1074 - slog 1075 - sortslice 1076 - stdmethods 1077 - stringintconv 1078 - structtag 1079 - testinggoroutine 1080 - tests 1081 - unmarshal 1082 - unreachable 1083 - unsafeptr 1084 - unusedresult 1085 - unusedwrite 1086 1087 # Enable all analyzers. 1088 # Default: false 1089 enable-all: true 1090 # Disable analyzers by name. 1091 # (in addition to default 1092 # atomicalign, deepequalerrors, fieldalignment, findcall, nilness, reflectvaluecompare, shadow, sortslice, 1093 # timeformat, unusedwrite 1094 # ). 1095 # Run `GL_DEBUG=govet golangci-lint run --enable=govet` to see default, all available analyzers, and enabled analyzers. 1096 # Default: [] 1097 disable: 1098 - appends 1099 - asmdecl 1100 - assign 1101 - atomic 1102 - atomicalign 1103 - bools 1104 - buildtag 1105 - cgocall 1106 - composites 1107 - copylocks 1108 - deepequalerrors 1109 - defers 1110 - directive 1111 - errorsas 1112 - fieldalignment 1113 - findcall 1114 - framepointer 1115 - httpresponse 1116 - ifaceassert 1117 - loopclosure 1118 - lostcancel 1119 - nilfunc 1120 - nilness 1121 - printf 1122 - reflectvaluecompare 1123 - shadow 1124 - shift 1125 - sigchanyzer 1126 - slog 1127 - sortslice 1128 - stdmethods 1129 - stringintconv 1130 - structtag 1131 - testinggoroutine 1132 - tests 1133 - unmarshal 1134 - unreachable 1135 - unsafeptr 1136 - unusedresult 1137 - unusedwrite 1138 1139 # Settings per analyzer. 1140 settings: 1141 # Analyzer name, run `go tool vet help` to see all analyzers. 1142 printf: 1143 # Comma-separated list of print function names to check (in addition to default, see `go tool vet help printf`). 1144 # Default: [] 1145 funcs: 1146 - (github.com/nalekseevs/itns-golangci-lint/pkg/logutils.Log).Infof 1147 - (github.com/nalekseevs/itns-golangci-lint/pkg/logutils.Log).Warnf 1148 - (github.com/nalekseevs/itns-golangci-lint/pkg/logutils.Log).Errorf 1149 - (github.com/nalekseevs/itns-golangci-lint/pkg/logutils.Log).Fatalf 1150 shadow: 1151 # Whether to be strict about shadowing; can be noisy. 1152 # Default: false 1153 strict: true 1154 unusedresult: 1155 # Comma-separated list of functions whose results must be used 1156 # (in addition to default: 1157 # context.WithCancel, context.WithDeadline, context.WithTimeout, context.WithValue, errors.New, fmt.Errorf, 1158 # fmt.Sprint, fmt.Sprintf, sort.Reverse 1159 # ). 1160 # Default: [] 1161 funcs: 1162 - pkg.MyFunc 1163 # Comma-separated list of names of methods of type func() string whose results must be used 1164 # (in addition to default Error,String) 1165 # Default: [] 1166 stringmethods: 1167 - MyMethod 1168 1169 grouper: 1170 # Require the use of a single global 'const' declaration only. 1171 # Default: false 1172 const-require-single-const: true 1173 # Require the use of grouped global 'const' declarations. 1174 # Default: false 1175 const-require-grouping: true 1176 1177 # Require the use of a single 'import' declaration only. 1178 # Default: false 1179 import-require-single-import: true 1180 # Require the use of grouped 'import' declarations. 1181 # Default: false 1182 import-require-grouping: true 1183 1184 # Require the use of a single global 'type' declaration only. 1185 # Default: false 1186 type-require-single-type: true 1187 # Require the use of grouped global 'type' declarations. 1188 # Default: false 1189 type-require-grouping: true 1190 1191 # Require the use of a single global 'var' declaration only. 1192 # Default: false 1193 var-require-single-var: true 1194 # Require the use of grouped global 'var' declarations. 1195 # Default: false 1196 var-require-grouping: true 1197 1198 importas: 1199 # Do not allow unaliased imports of aliased packages. 1200 # Default: false 1201 no-unaliased: true 1202 # Do not allow non-required aliases. 1203 # Default: false 1204 no-extra-aliases: true 1205 # List of aliases 1206 # Default: [] 1207 alias: 1208 # Using `servingv1` alias for `knative.dev/serving/pkg/apis/serving/v1` package. 1209 - pkg: knative.dev/serving/pkg/apis/serving/v1 1210 alias: servingv1 1211 # Using `autoscalingv1alpha1` alias for `knative.dev/serving/pkg/apis/autoscaling/v1alpha1` package. 1212 - pkg: knative.dev/serving/pkg/apis/autoscaling/v1alpha1 1213 alias: autoscalingv1alpha1 1214 # You can specify the package path by regular expression, 1215 # and alias by regular expression expansion syntax like below. 1216 # see https://github.com/julz/importas#use-regular-expression for details 1217 - pkg: knative.dev/serving/pkg/apis/(\w+)/(v[\w\d]+) 1218 alias: $1$2 1219 1220 inamedparam: 1221 # Skips check for interface methods with only a single parameter. 1222 # Default: false 1223 skip-single-param: true 1224 1225 interfacebloat: 1226 # The maximum number of methods allowed for an interface. 1227 # Default: 10 1228 max: 5 1229 1230 ireturn: 1231 # ireturn does not allow using `allow` and `reject` settings at the same time. 1232 # Both settings are lists of the keywords and regular expressions matched to interface or package names. 1233 # keywords: 1234 # - `empty` for `interface{}` 1235 # - `error` for errors 1236 # - `stdlib` for standard library 1237 # - `anon` for anonymous interfaces 1238 # - `generic` for generic interfaces added in go 1.18 1239 1240 # By default, it allows using errors, empty interfaces, anonymous interfaces, 1241 # and interfaces provided by the standard library. 1242 allow: 1243 - anon 1244 - error 1245 - empty 1246 - stdlib 1247 # You can specify idiomatic endings for interface 1248 - (or|er)$ 1249 1250 # reject-list of interfaces 1251 reject: 1252 - github.com\/user\/package\/v4\.Type 1253 1254 lll: 1255 # Max line length, lines longer will be reported. 1256 # '\t' is counted as 1 character by default, and can be changed with the tab-width option. 1257 # Default: 120. 1258 line-length: 120 1259 # Tab width in spaces. 1260 # Default: 1 1261 tab-width: 1 1262 1263 loggercheck: 1264 # Allow check for the github.com/go-kit/log library. 1265 # Default: true 1266 kitlog: false 1267 # Allow check for the k8s.io/klog/v2 library. 1268 # Default: true 1269 klog: false 1270 # Allow check for the github.com/go-logr/logr library. 1271 # Default: true 1272 logr: false 1273 # Allow check for the "sugar logger" from go.uber.org/zap library. 1274 # Default: true 1275 zap: false 1276 # Require all logging keys to be inlined constant strings. 1277 # Default: false 1278 require-string-key: true 1279 # Require printf-like format specifier (%s, %d for example) not present. 1280 # Default: false 1281 no-printf-like: true 1282 # List of custom rules to check against, where each rule is a single logger pattern, useful for wrapped loggers. 1283 # For example: https://github.com/timonwong/loggercheck/blob/7395ab86595781e33f7afba27ad7b55e6956ebcd/testdata/custom-rules.txt 1284 # Default: empty 1285 rules: 1286 - k8s.io/klog/v2.InfoS # package level exported functions 1287 - (github.com/go-logr/logr.Logger).Error # "Methods" 1288 - (*go.uber.org/zap.SugaredLogger).With # Also "Methods", but with a pointer receiver 1289 1290 maintidx: 1291 # Show functions with maintainability index lower than N. 1292 # A high index indicates better maintainability (it's kind of the opposite of complexity). 1293 # Default: 20 1294 under: 100 1295 1296 makezero: 1297 # Allow only slices initialized with a length of zero. 1298 # Default: false 1299 always: true 1300 1301 misspell: 1302 # Correct spellings using locale preferences for US or UK. 1303 # Setting locale to US will correct the British spelling of 'colour' to 'color'. 1304 # Default is to use a neutral variety of English. 1305 locale: US 1306 # Typos to ignore. 1307 # Should be in lower case. 1308 # Default: [] 1309 ignore-words: 1310 - someword 1311 # Extra word corrections. 1312 # `typo` and `correction` should only contain letters. 1313 # The words are case-insensitive. 1314 # Default: [] 1315 extra-words: 1316 - typo: "iff" 1317 correction: "if" 1318 - typo: "cancelation" 1319 correction: "cancellation" 1320 # Mode of the analysis: 1321 # - default: checks all the file content. 1322 # - restricted: checks only comments. 1323 # Default: "" 1324 mode: restricted 1325 1326 mnd: 1327 # List of enabled checks, see https://github.com/tommy-muehle/go-mnd/#checks for description. 1328 # Default: ["argument", "case", "condition", "operation", "return", "assign"] 1329 checks: 1330 - argument 1331 - case 1332 - condition 1333 - operation 1334 - return 1335 - assign 1336 # List of numbers to exclude from analysis. 1337 # The numbers should be written as string. 1338 # Values always ignored: "1", "1.0", "0" and "0.0" 1339 # Default: [] 1340 ignored-numbers: 1341 - '0666' 1342 - '0755' 1343 - '42' 1344 # List of file patterns to exclude from analysis. 1345 # Values always ignored: `.+_test.go` 1346 # Default: [] 1347 ignored-files: 1348 - 'magic1_.+\.go$' 1349 # List of function patterns to exclude from analysis. 1350 # Following functions are always ignored: `time.Date`, 1351 # `strconv.FormatInt`, `strconv.FormatUint`, `strconv.FormatFloat`, 1352 # `strconv.ParseInt`, `strconv.ParseUint`, `strconv.ParseFloat`. 1353 # Default: [] 1354 ignored-functions: 1355 - '^math\.' 1356 - '^http\.StatusText$' 1357 1358 musttag: 1359 # A set of custom functions to check in addition to the builtin ones. 1360 # Default: json, xml, gopkg.in/yaml.v3, BurntSushi/toml, mitchellh/mapstructure, jmoiron/sqlx 1361 functions: 1362 # The full name of the function, including the package. 1363 - name: github.com/hashicorp/hcl/v2/hclsimple.DecodeFile 1364 # The struct tag whose presence should be ensured. 1365 tag: hcl 1366 # The position of the argument to check. 1367 arg-pos: 2 1368 1369 nakedret: 1370 # Make an issue if func has more lines of code than this setting, and it has naked returns. 1371 # Default: 30 1372 max-func-lines: 31 1373 1374 nestif: 1375 # Minimal complexity of if statements to report. 1376 # Default: 5 1377 min-complexity: 4 1378 1379 nilnil: 1380 # Checks that there is no simultaneous return of `nil` error and an invalid value. 1381 # Default: ["ptr", "func", "iface", "map", "chan"] 1382 checked-types: 1383 - ptr 1384 - func 1385 - iface 1386 - map 1387 - chan 1388 1389 nlreturn: 1390 # Size of the block (including return statement that is still "OK") 1391 # so no return split required. 1392 # Default: 1 1393 block-size: 2 1394 1395 nolintlint: 1396 # Disable to ensure that all nolint directives actually have an effect. 1397 # Default: false 1398 allow-unused: true 1399 # Exclude following linters from requiring an explanation. 1400 # Default: [] 1401 allow-no-explanation: [ ] 1402 # Enable to require an explanation of nonzero length after each nolint directive. 1403 # Default: false 1404 require-explanation: true 1405 # Enable to require nolint directives to mention the specific linter being suppressed. 1406 # Default: false 1407 require-specific: true 1408 1409 nonamedreturns: 1410 # Report named error if it is assigned inside defer. 1411 # Default: false 1412 report-error-in-defer: true 1413 1414 paralleltest: 1415 # Ignore missing calls to `t.Parallel()` and only report incorrect uses of it. 1416 # Default: false 1417 ignore-missing: true 1418 # Ignore missing calls to `t.Parallel()` in subtests. Top-level tests are 1419 # still required to have `t.Parallel`, but subtests are allowed to skip it. 1420 # Default: false 1421 ignore-missing-subtests: true 1422 1423 perfsprint: 1424 # Optimizes even if it requires an int or uint type cast. 1425 # Default: true 1426 int-conversion: false 1427 # Optimizes into `err.Error()` even if it is only equivalent for non-nil errors. 1428 # Default: false 1429 err-error: true 1430 # Optimizes `fmt.Errorf`. 1431 # Default: true 1432 errorf: false 1433 # Optimizes `fmt.Sprintf` with only one argument. 1434 # Default: true 1435 sprintf1: false 1436 # Optimizes into strings concatenation. 1437 # Default: true 1438 strconcat: false 1439 1440 prealloc: 1441 # IMPORTANT: we don't recommend using this linter before doing performance profiling. 1442 # For most programs usage of prealloc will be a premature optimization. 1443 1444 # Report pre-allocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them. 1445 # Default: true 1446 simple: false 1447 # Report pre-allocation suggestions on range loops. 1448 # Default: true 1449 range-loops: false 1450 # Report pre-allocation suggestions on for loops. 1451 # Default: false 1452 for-loops: true 1453 1454 predeclared: 1455 # Comma-separated list of predeclared identifiers to not report on. 1456 # Default: "" 1457 ignore: "new,int" 1458 # Include method names and field names (i.e., qualified names) in checks. 1459 # Default: false 1460 q: true 1461 1462 promlinter: 1463 # Promlinter cannot infer all metrics name in static analysis. 1464 # Enable strict mode will also include the errors caused by failing to parse the args. 1465 # Default: false 1466 strict: true 1467 # Please refer to https://github.com/yeya24/promlinter#usage for detailed usage. 1468 # Default: [] 1469 disabled-linters: 1470 - Help 1471 - MetricUnits 1472 - Counter 1473 - HistogramSummaryReserved 1474 - MetricTypeInName 1475 - ReservedChars 1476 - CamelCase 1477 - UnitAbbreviations 1478 1479 protogetter: 1480 # Skip files generated by specified generators from the checking. 1481 # Checks only the file's initial comment, which must follow the format: "// Code generated by <generator-name>". 1482 # Files generated by protoc-gen-go, protoc-gen-go-grpc, and protoc-gen-grpc-gateway are always excluded automatically. 1483 # Default: [] 1484 skip-generated-by: ["protoc-gen-go-my-own-generator"] 1485 # Skip files matching the specified glob pattern from the checking. 1486 # Default: [] 1487 skip-files: 1488 - "*.pb.go" 1489 - "*/vendor/*" 1490 - "/full/path/to/file.go" 1491 # Skip any generated files from the checking. 1492 # Default: false 1493 skip-any-generated: true 1494 # Skip first argument of append function. 1495 # Default: false 1496 replace-first-arg-in-append: true 1497 1498 reassign: 1499 # Patterns for global variable names that are checked for reassignment. 1500 # See https://github.com/curioswitch/go-reassign#usage 1501 # Default: ["EOF", "Err.*"] 1502 patterns: 1503 - ".*" 1504 1505 revive: 1506 # Maximum number of open files at the same time. 1507 # See https://github.com/mgechev/revive#command-line-flags 1508 # Defaults to unlimited. 1509 max-open-files: 2048 1510 1511 # When set to false, ignores files with "GENERATED" header, similar to golint. 1512 # See https://github.com/mgechev/revive#available-rules for details. 1513 # Default: false 1514 ignore-generated-header: true 1515 1516 # Sets the default severity. 1517 # See https://github.com/mgechev/revive#configuration 1518 # Default: warning 1519 severity: error 1520 1521 # Enable all available rules. 1522 # Default: false 1523 enable-all-rules: true 1524 1525 # Sets the default failure confidence. 1526 # This means that linting errors with less than 0.8 confidence will be ignored. 1527 # Default: 0.8 1528 confidence: 0.1 1529 1530 rules: 1531 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#add-constant 1532 - name: add-constant 1533 severity: warning 1534 disabled: false 1535 exclude: [""] 1536 arguments: 1537 - maxLitCount: "3" 1538 allowStrs: '""' 1539 allowInts: "0,1,2" 1540 allowFloats: "0.0,0.,1.0,1.,2.0,2." 1541 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#argument-limit 1542 - name: argument-limit 1543 severity: warning 1544 disabled: false 1545 exclude: [""] 1546 arguments: [ 4 ] 1547 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#atomic 1548 - name: atomic 1549 severity: warning 1550 exclude: [""] 1551 disabled: false 1552 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#banned-characters 1553 - name: banned-characters 1554 severity: warning 1555 disabled: false 1556 exclude: [""] 1557 arguments: [ "Ω","Σ","σ", "7" ] 1558 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#bare-return 1559 - name: bare-return 1560 severity: warning 1561 exclude: [""] 1562 disabled: false 1563 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#blank-imports 1564 - name: blank-imports 1565 severity: warning 1566 exclude: [""] 1567 disabled: false 1568 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#bool-literal-in-expr 1569 - name: bool-literal-in-expr 1570 severity: warning 1571 exclude: [""] 1572 disabled: false 1573 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#call-to-gc 1574 - name: call-to-gc 1575 severity: warning 1576 exclude: [""] 1577 disabled: false 1578 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#cognitive-complexity 1579 - name: cognitive-complexity 1580 severity: warning 1581 disabled: false 1582 exclude: [""] 1583 arguments: [ 7 ] 1584 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#comment-spacings 1585 - name: comment-spacings 1586 severity: warning 1587 disabled: false 1588 exclude: [""] 1589 arguments: 1590 - mypragma 1591 - otherpragma 1592 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#confusing-naming 1593 - name: confusing-naming 1594 severity: warning 1595 disabled: false 1596 exclude: [""] 1597 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#confusing-results 1598 - name: confusing-results 1599 severity: warning 1600 disabled: false 1601 exclude: [""] 1602 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#constant-logical-expr 1603 - name: constant-logical-expr 1604 severity: warning 1605 disabled: false 1606 exclude: [""] 1607 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#context-as-argument 1608 - name: context-as-argument 1609 severity: warning 1610 disabled: false 1611 exclude: [""] 1612 arguments: 1613 - allowTypesBefore: "*testing.T,*github.com/user/repo/testing.Harness" 1614 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#context-keys-type 1615 - name: context-keys-type 1616 severity: warning 1617 disabled: false 1618 exclude: [""] 1619 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#cyclomatic 1620 - name: cyclomatic 1621 severity: warning 1622 disabled: false 1623 exclude: [""] 1624 arguments: [ 3 ] 1625 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#datarace 1626 - name: datarace 1627 severity: warning 1628 disabled: false 1629 exclude: [""] 1630 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#deep-exit 1631 - name: deep-exit 1632 severity: warning 1633 disabled: false 1634 exclude: [""] 1635 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#defer 1636 - name: defer 1637 severity: warning 1638 disabled: false 1639 exclude: [""] 1640 arguments: 1641 - [ "call-chain", "loop" ] 1642 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#dot-imports 1643 - name: dot-imports 1644 severity: warning 1645 disabled: false 1646 exclude: [""] 1647 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#duplicated-imports 1648 - name: duplicated-imports 1649 severity: warning 1650 disabled: false 1651 exclude: [""] 1652 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#early-return 1653 - name: early-return 1654 severity: warning 1655 disabled: false 1656 exclude: [""] 1657 arguments: 1658 - "preserveScope" 1659 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#empty-block 1660 - name: empty-block 1661 severity: warning 1662 disabled: false 1663 exclude: [""] 1664 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#empty-lines 1665 - name: empty-lines 1666 severity: warning 1667 disabled: false 1668 exclude: [""] 1669 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#enforce-map-style 1670 - name: enforce-map-style 1671 severity: warning 1672 disabled: false 1673 exclude: [""] 1674 arguments: 1675 - "make" 1676 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#enforce-repeated-arg-type-style 1677 - name: enforce-repeated-arg-type-style 1678 severity: warning 1679 disabled: false 1680 exclude: [""] 1681 arguments: 1682 - "short" 1683 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#enforce-slice-style 1684 - name: enforce-slice-style 1685 severity: warning 1686 disabled: false 1687 exclude: [""] 1688 arguments: 1689 - "make" 1690 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#error-naming 1691 - name: error-naming 1692 severity: warning 1693 disabled: false 1694 exclude: [""] 1695 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#error-return 1696 - name: error-return 1697 severity: warning 1698 disabled: false 1699 exclude: [""] 1700 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#error-strings 1701 - name: error-strings 1702 severity: warning 1703 disabled: false 1704 exclude: [""] 1705 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#errorf 1706 - name: errorf 1707 severity: warning 1708 disabled: false 1709 exclude: [""] 1710 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#exported 1711 - name: exported 1712 severity: warning 1713 disabled: false 1714 exclude: [""] 1715 arguments: 1716 - "preserveScope" 1717 - "checkPrivateReceivers" 1718 - "sayRepetitiveInsteadOfStutters" 1719 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#file-header 1720 - name: file-header 1721 severity: warning 1722 disabled: false 1723 exclude: [""] 1724 arguments: 1725 - This is the text that must appear at the top of source files. 1726 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#flag-parameter 1727 - name: flag-parameter 1728 severity: warning 1729 disabled: false 1730 exclude: [""] 1731 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#function-result-limit 1732 - name: function-result-limit 1733 severity: warning 1734 disabled: false 1735 exclude: [""] 1736 arguments: [ 2 ] 1737 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#function-length 1738 - name: function-length 1739 severity: warning 1740 disabled: false 1741 exclude: [""] 1742 arguments: [ 10, 0 ] 1743 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#get-return 1744 - name: get-return 1745 severity: warning 1746 disabled: false 1747 exclude: [""] 1748 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#identical-branches 1749 - name: identical-branches 1750 severity: warning 1751 disabled: false 1752 exclude: [""] 1753 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#if-return 1754 - name: if-return 1755 severity: warning 1756 disabled: false 1757 exclude: [""] 1758 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#increment-decrement 1759 - name: increment-decrement 1760 severity: warning 1761 disabled: false 1762 exclude: [""] 1763 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#indent-error-flow 1764 - name: indent-error-flow 1765 severity: warning 1766 disabled: false 1767 exclude: [""] 1768 arguments: 1769 - "preserveScope" 1770 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#import-alias-naming 1771 - name: import-alias-naming 1772 severity: warning 1773 disabled: false 1774 exclude: [""] 1775 arguments: 1776 - "^[a-z][a-z0-9]{0,}$" 1777 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#imports-blocklist 1778 - name: imports-blocklist 1779 severity: warning 1780 disabled: false 1781 exclude: [""] 1782 arguments: 1783 - "crypto/md5" 1784 - "crypto/sha1" 1785 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#import-shadowing 1786 - name: import-shadowing 1787 severity: warning 1788 disabled: false 1789 exclude: [""] 1790 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#line-length-limit 1791 - name: line-length-limit 1792 severity: warning 1793 disabled: false 1794 exclude: [""] 1795 arguments: [ 80 ] 1796 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#max-control-nesting 1797 - name: max-control-nesting 1798 severity: warning 1799 disabled: false 1800 exclude: [""] 1801 arguments: [ 3 ] 1802 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#max-public-structs 1803 - name: max-public-structs 1804 severity: warning 1805 disabled: false 1806 exclude: [""] 1807 arguments: [ 3 ] 1808 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#modifies-parameter 1809 - name: modifies-parameter 1810 severity: warning 1811 disabled: false 1812 exclude: [""] 1813 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#modifies-value-receiver 1814 - name: modifies-value-receiver 1815 severity: warning 1816 disabled: false 1817 exclude: [""] 1818 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#nested-structs 1819 - name: nested-structs 1820 severity: warning 1821 disabled: false 1822 exclude: [""] 1823 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#optimize-operands-order 1824 - name: optimize-operands-order 1825 severity: warning 1826 disabled: false 1827 exclude: [""] 1828 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#package-comments 1829 - name: package-comments 1830 severity: warning 1831 disabled: false 1832 exclude: [""] 1833 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#range 1834 - name: range 1835 severity: warning 1836 disabled: false 1837 exclude: [""] 1838 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#range-val-in-closure 1839 - name: range-val-in-closure 1840 severity: warning 1841 disabled: false 1842 exclude: [""] 1843 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#range-val-address 1844 - name: range-val-address 1845 severity: warning 1846 disabled: false 1847 exclude: [""] 1848 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#receiver-naming 1849 - name: receiver-naming 1850 severity: warning 1851 disabled: false 1852 exclude: [""] 1853 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#redundant-import-alias 1854 - name: redundant-import-alias 1855 severity: warning 1856 disabled: false 1857 exclude: [""] 1858 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#redefines-builtin-id 1859 - name: redefines-builtin-id 1860 severity: warning 1861 disabled: false 1862 exclude: [""] 1863 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#string-of-int 1864 - name: string-of-int 1865 severity: warning 1866 disabled: false 1867 exclude: [""] 1868 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#string-format 1869 - name: string-format 1870 severity: warning 1871 disabled: false 1872 exclude: [""] 1873 arguments: 1874 - - 'core.WriteError[1].Message' 1875 - '/^([^A-Z]|$)/' 1876 - must not start with a capital letter 1877 - - 'fmt.Errorf[0]' 1878 - '/(^|[^\.!?])$/' 1879 - must not end in punctuation 1880 - - panic 1881 - '/^[^\n]*$/' 1882 - must not contain line breaks 1883 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#struct-tag 1884 - name: struct-tag 1885 arguments: 1886 - "json,inline" 1887 - "bson,outline,gnu" 1888 severity: warning 1889 disabled: false 1890 exclude: [""] 1891 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#superfluous-else 1892 - name: superfluous-else 1893 severity: warning 1894 disabled: false 1895 exclude: [""] 1896 arguments: 1897 - "preserveScope" 1898 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#time-equal 1899 - name: time-equal 1900 severity: warning 1901 disabled: false 1902 exclude: [""] 1903 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#time-naming 1904 - name: time-naming 1905 severity: warning 1906 disabled: false 1907 exclude: [""] 1908 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#var-naming 1909 - name: var-naming 1910 severity: warning 1911 disabled: false 1912 exclude: [""] 1913 arguments: 1914 - [ "ID" ] # AllowList 1915 - [ "VM" ] # DenyList 1916 - - upperCaseConst: true 1917 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#var-declaration 1918 - name: var-declaration 1919 severity: warning 1920 disabled: false 1921 exclude: [""] 1922 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unconditional-recursion 1923 - name: unconditional-recursion 1924 severity: warning 1925 disabled: false 1926 exclude: [""] 1927 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unexported-naming 1928 - name: unexported-naming 1929 severity: warning 1930 disabled: false 1931 exclude: [""] 1932 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unexported-return 1933 - name: unexported-return 1934 severity: warning 1935 disabled: false 1936 exclude: [""] 1937 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unhandled-error 1938 - name: unhandled-error 1939 severity: warning 1940 disabled: false 1941 exclude: [""] 1942 arguments: 1943 - "fmt.Printf" 1944 - "myFunction" 1945 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unnecessary-stmt 1946 - name: unnecessary-stmt 1947 severity: warning 1948 disabled: false 1949 exclude: [""] 1950 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unreachable-code 1951 - name: unreachable-code 1952 severity: warning 1953 disabled: false 1954 exclude: [""] 1955 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-parameter 1956 - name: unused-parameter 1957 severity: warning 1958 disabled: false 1959 exclude: [""] 1960 arguments: 1961 - allowRegex: "^_" 1962 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-receiver 1963 - name: unused-receiver 1964 severity: warning 1965 disabled: false 1966 exclude: [""] 1967 arguments: 1968 - allowRegex: "^_" 1969 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#useless-break 1970 - name: useless-break 1971 severity: warning 1972 disabled: false 1973 exclude: [""] 1974 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#waitgroup-by-value 1975 - name: waitgroup-by-value 1976 severity: warning 1977 disabled: false 1978 exclude: [""] 1979 1980 rowserrcheck: 1981 # database/sql is always checked 1982 # Default: [] 1983 packages: 1984 - github.com/jmoiron/sqlx 1985 1986 sloglint: 1987 # Enforce not mixing key-value pairs and attributes. 1988 # Default: true 1989 no-mixed-args: false 1990 # Enforce using key-value pairs only (overrides no-mixed-args, incompatible with attr-only). 1991 # Default: false 1992 kv-only: true 1993 # Enforce using attributes only (overrides no-mixed-args, incompatible with kv-only). 1994 # Default: false 1995 attr-only: true 1996 # Enforce not using global loggers. 1997 # Values: 1998 # - "": disabled 1999 # - "all": report all global loggers 2000 # - "default": report only the default slog logger 2001 # Default: "" 2002 no-global: "all" 2003 # Enforce using methods that accept a context. 2004 # Values: 2005 # - "": disabled 2006 # - "all": report all contextless calls 2007 # - "scope": report only if a context exists in the scope of the outermost function 2008 # Default: "" 2009 context: "all" 2010 # Enforce using static values for log messages. 2011 # Default: false 2012 static-msg: true 2013 # Enforce using constants instead of raw keys. 2014 # Default: false 2015 no-raw-keys: true 2016 # Enforce a single key naming convention. 2017 # Values: snake, kebab, camel, pascal 2018 # Default: "" 2019 key-naming-case: snake 2020 # Enforce putting arguments on separate lines. 2021 # Default: false 2022 args-on-sep-lines: true 2023 2024 spancheck: 2025 # Checks to enable. 2026 # Options include: 2027 # - `end`: check that `span.End()` is called 2028 # - `record-error`: check that `span.RecordError(err)` is called when an error is returned 2029 # - `set-status`: check that `span.SetStatus(codes.Error, msg)` is called when an error is returned 2030 # Default: ["end"] 2031 checks: 2032 - end 2033 - record-error 2034 - set-status 2035 # A list of regexes for function signatures that silence `record-error` and `set-status` reports 2036 # if found in the call path to a returned error. 2037 # https://github.com/jjti/go-spancheck#ignore-check-signatures 2038 # Default: [] 2039 ignore-check-signatures: 2040 - "telemetry.RecordError" 2041 # A list of regexes for additional function signatures that create spans. 2042 # This is useful if you have a utility method to create spans. 2043 # Each entry should be of the form `<regex>:<telemetry-type>`, where `telemetry-type` can be `opentelemetry` or `opencensus`. 2044 # https://github.com/jjti/go-spancheck#extra-start-span-signatures 2045 # Default: [] 2046 extra-start-span-signatures: 2047 - "github.com/user/repo/telemetry/trace.Start:opentelemetry" 2048 staticcheck: 2049 # SAxxxx checks in https://staticcheck.io/docs/configuration/options/#checks 2050 # Default: ["*"] 2051 checks: [ "all" ] 2052 2053 stylecheck: 2054 # STxxxx checks in https://staticcheck.io/docs/configuration/options/#checks 2055 # Default: ["*"] 2056 checks: [ "all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022" ] 2057 # https://staticcheck.io/docs/configuration/options/#dot_import_whitelist 2058 # Default: ["github.com/mmcloughlin/avo/build", "github.com/mmcloughlin/avo/operand", "github.com/mmcloughlin/avo/reg"] 2059 dot-import-whitelist: 2060 - fmt 2061 # https://staticcheck.io/docs/configuration/options/#initialisms 2062 # Default: ["ACL", "API", "ASCII", "CPU", "CSS", "DNS", "EOF", "GUID", "HTML", "HTTP", "HTTPS", "ID", "IP", "JSON", "QPS", "RAM", "RPC", "SLA", "SMTP", "SQL", "SSH", "TCP", "TLS", "TTL", "UDP", "UI", "GID", "UID", "UUID", "URI", "URL", "UTF8", "VM", "XML", "XMPP", "XSRF", "XSS", "SIP", "RTP", "AMQP", "DB", "TS"] 2063 initialisms: [ "ACL", "API", "ASCII", "CPU", "CSS", "DNS", "EOF", "GUID", "HTML", "HTTP", "HTTPS", "ID", "IP", "JSON", "QPS", "RAM", "RPC", "SLA", "SMTP", "SQL", "SSH", "TCP", "TLS", "TTL", "UDP", "UI", "GID", "UID", "UUID", "URI", "URL", "UTF8", "VM", "XML", "XMPP", "XSRF", "XSS", "SIP", "RTP", "AMQP", "DB", "TS" ] 2064 # https://staticcheck.io/docs/configuration/options/#http_status_code_whitelist 2065 # Default: ["200", "400", "404", "500"] 2066 http-status-code-whitelist: [ "200", "400", "404", "500" ] 2067 2068 tagalign: 2069 # Align and sort can be used together or separately. 2070 # 2071 # Whether enable align. If true, the struct tags will be aligned. 2072 # e.g.: 2073 # type FooBar struct { 2074 # Bar string `json:"bar" validate:"required"` 2075 # FooFoo int8 `json:"foo_foo" validate:"required"` 2076 # } 2077 # will be formatted to: 2078 # type FooBar struct { 2079 # Bar string `json:"bar" validate:"required"` 2080 # FooFoo int8 `json:"foo_foo" validate:"required"` 2081 # } 2082 # Default: true. 2083 align: false 2084 # Whether enable tags sort. 2085 # If true, the tags will be sorted by name in ascending order. 2086 # e.g.: `xml:"bar" json:"bar" validate:"required"` -> `json:"bar" validate:"required" xml:"bar"` 2087 # Default: true 2088 sort: false 2089 # Specify the order of tags, the other tags will be sorted by name. 2090 # This option will be ignored if `sort` is false. 2091 # Default: [] 2092 order: 2093 - json 2094 - yaml 2095 - yml 2096 - toml 2097 - mapstructure 2098 - binding 2099 - validate 2100 # Whether enable strict style. 2101 # In this style, the tags will be sorted and aligned in the dictionary order, 2102 # and the tags with the same name will be aligned together. 2103 # Note: This option will be ignored if 'align' or 'sort' is false. 2104 # Default: false 2105 strict: true 2106 2107 tagliatelle: 2108 # Check the struct tag name case. 2109 case: 2110 # Use the struct field name to check the name of the struct tag. 2111 # Default: false 2112 use-field-name: true 2113 # `camel` is used for `json` and `yaml`, and `header` is used for `header` (can be overridden) 2114 # Default: {} 2115 rules: 2116 # Any struct tag type can be used. 2117 # Support string case: `camel`, `pascal`, `kebab`, `snake`, `upperSnake`, `goCamel`, `goPascal`, `goKebab`, `goSnake`, `upper`, `lower`, `header` 2118 json: camel 2119 yaml: camel 2120 xml: camel 2121 toml: camel 2122 bson: camel 2123 avro: snake 2124 mapstructure: kebab 2125 env: upperSnake 2126 envconfig: upperSnake 2127 2128 tenv: 2129 # The option `all` will run against whole test files (`_test.go`) regardless of method/function signatures. 2130 # Otherwise, only methods that take `*testing.T`, `*testing.B`, and `testing.TB` as arguments are checked. 2131 # Default: false 2132 all: false 2133 2134 testifylint: 2135 # Enable all checkers (https://github.com/Antonboom/testifylint#checkers). 2136 # Default: false 2137 enable-all: true 2138 # Disable checkers by name 2139 # (in addition to default 2140 # suite-thelper 2141 # ). 2142 disable: 2143 - blank-import 2144 - bool-compare 2145 - compares 2146 - empty 2147 - error-is-as 2148 - error-nil 2149 - expected-actual 2150 - go-require 2151 - float-compare 2152 - len 2153 - nil-compare 2154 - require-error 2155 - suite-dont-use-pkg 2156 - suite-extra-assert-call 2157 - suite-thelper 2158 - useless-assert 2159 2160 # Disable all checkers (https://github.com/Antonboom/testifylint#checkers). 2161 # Default: false 2162 disable-all: true 2163 # Enable checkers by name 2164 # (in addition to default 2165 # blank-import, bool-compare, compares, empty, error-is-as, error-nil, expected-actual, go-require, float-compare, 2166 # len, nil-compare, require-error, suite-dont-use-pkg, suite-extra-assert-call, useless-assert 2167 # ). 2168 enable: 2169 - blank-import 2170 - bool-compare 2171 - compares 2172 - empty 2173 - error-is-as 2174 - error-nil 2175 - expected-actual 2176 - go-require 2177 - float-compare 2178 - len 2179 - nil-compare 2180 - require-error 2181 - suite-dont-use-pkg 2182 - suite-extra-assert-call 2183 - suite-thelper 2184 - useless-assert 2185 2186 bool-compare: 2187 # To ignore user defined types (over builtin bool). 2188 # Default: false 2189 ignore-custom-types: true 2190 expected-actual: 2191 # Regexp for expected variable name. 2192 # Default: (^(exp(ected)?|want(ed)?)([A-Z]\w*)?$)|(^(\w*[a-z])?(Exp(ected)?|Want(ed)?)$) 2193 pattern: ^expected 2194 require-error: 2195 # Regexp for assertions to analyze. If defined, then only matched error assertions will be reported. 2196 # Default: "" 2197 fn-pattern: ^(Errorf?|NoErrorf?)$ 2198 suite-extra-assert-call: 2199 # To require or remove extra Assert() call? 2200 # Default: remove 2201 mode: require 2202 2203 testpackage: 2204 # Regexp pattern to skip files. 2205 # Default: "(export|internal)_test\\.go" 2206 skip-regexp: (export|internal)_test\.go 2207 # List of packages that don't end with _test that tests are allowed to be in. 2208 # Default: "main" 2209 allow-packages: 2210 - example 2211 - main 2212 2213 thelper: 2214 test: 2215 # Check *testing.T is first param (or after context.Context) of helper function. 2216 # Default: true 2217 first: false 2218 # Check *testing.T param has name t. 2219 # Default: true 2220 name: false 2221 # Check t.Helper() begins helper function. 2222 # Default: true 2223 begin: false 2224 benchmark: 2225 # Check *testing.B is first param (or after context.Context) of helper function. 2226 # Default: true 2227 first: false 2228 # Check *testing.B param has name b. 2229 # Default: true 2230 name: false 2231 # Check b.Helper() begins helper function. 2232 # Default: true 2233 begin: false 2234 tb: 2235 # Check *testing.TB is first param (or after context.Context) of helper function. 2236 # Default: true 2237 first: false 2238 # Check *testing.TB param has name tb. 2239 # Default: true 2240 name: false 2241 # Check tb.Helper() begins helper function. 2242 # Default: true 2243 begin: false 2244 fuzz: 2245 # Check *testing.F is first param (or after context.Context) of helper function. 2246 # Default: true 2247 first: false 2248 # Check *testing.F param has name f. 2249 # Default: true 2250 name: false 2251 # Check f.Helper() begins helper function. 2252 # Default: true 2253 begin: false 2254 2255 usestdlibvars: 2256 # Suggest the use of http.MethodXX. 2257 # Default: true 2258 http-method: false 2259 # Suggest the use of http.StatusXX. 2260 # Default: true 2261 http-status-code: false 2262 # Suggest the use of time.Weekday.String(). 2263 # Default: true 2264 time-weekday: true 2265 # Suggest the use of time.Month.String(). 2266 # Default: false 2267 time-month: true 2268 # Suggest the use of time.Layout. 2269 # Default: false 2270 time-layout: true 2271 # Suggest the use of crypto.Hash.String(). 2272 # Default: false 2273 crypto-hash: true 2274 # Suggest the use of rpc.DefaultXXPath. 2275 # Default: false 2276 default-rpc-path: true 2277 # Suggest the use of sql.LevelXX.String(). 2278 # Default: false 2279 sql-isolation-level: true 2280 # Suggest the use of tls.SignatureScheme.String(). 2281 # Default: false 2282 tls-signature-scheme: true 2283 # Suggest the use of constant.Kind.String(). 2284 # Default: false 2285 constant-kind: true 2286 2287 unconvert: 2288 # Remove conversions that force intermediate rounding. 2289 # Default: false 2290 fast-math: true 2291 # Be more conservative (experimental). 2292 # Default: false 2293 safe: true 2294 2295 unparam: 2296 # Inspect exported functions. 2297 # 2298 # Set to true if no external program/library imports your code. 2299 # XXX: if you enable this setting, unparam will report a lot of false-positives in text editors: 2300 # if it's called for subdir of a project it can't find external interfaces. All text editor integrations 2301 # with golangci-lint call it on a directory with the changed file. 2302 # 2303 # Default: false 2304 check-exported: true 2305 2306 unused: 2307 # Mark all struct fields that have been written to as used. 2308 # Default: true 2309 field-writes-are-uses: false 2310 # Treat IncDec statement (e.g. `i++` or `i--`) as both read and write operation instead of just write. 2311 # Default: false 2312 post-statements-are-reads: true 2313 # Mark all exported identifiers as used. 2314 # Default: true 2315 exported-is-used: false 2316 # Mark all exported fields as used. 2317 # default: true 2318 exported-fields-are-used: false 2319 # Mark all function parameters as used. 2320 # default: true 2321 parameters-are-used: false 2322 # Mark all local variables as used. 2323 # default: true 2324 local-variables-are-used: false 2325 # Mark all identifiers inside generated files as used. 2326 # Default: true 2327 generated-is-used: false 2328 2329 varnamelen: 2330 # The longest distance, in source lines, that is being considered a "small scope". 2331 # Variables used in at most this many lines will be ignored. 2332 # Default: 5 2333 max-distance: 6 2334 # The minimum length of a variable's name that is considered "long". 2335 # Variable names that are at least this long will be ignored. 2336 # Default: 3 2337 min-name-length: 2 2338 # Check method receivers. 2339 # Default: false 2340 check-receiver: true 2341 # Check named return values. 2342 # Default: false 2343 check-return: true 2344 # Check type parameters. 2345 # Default: false 2346 check-type-param: true 2347 # Ignore "ok" variables that hold the bool return value of a type assertion. 2348 # Default: false 2349 ignore-type-assert-ok: true 2350 # Ignore "ok" variables that hold the bool return value of a map index. 2351 # Default: false 2352 ignore-map-index-ok: true 2353 # Ignore "ok" variables that hold the bool return value of a channel receive. 2354 # Default: false 2355 ignore-chan-recv-ok: true 2356 # Optional list of variable names that should be ignored completely. 2357 # Default: [] 2358 ignore-names: 2359 - err 2360 # Optional list of variable declarations that should be ignored completely. 2361 # Entries must be in one of the following forms (see below for examples): 2362 # - for variables, parameters, named return values, method receivers, or type parameters: 2363 # <name> <type> (<type> can also be a pointer/slice/map/chan/...) 2364 # - for constants: const <name> 2365 # 2366 # Default: [] 2367 ignore-decls: 2368 - c echo.Context 2369 - t testing.T 2370 - f *foo.Bar 2371 - e error 2372 - i int 2373 - const C 2374 - T any 2375 - m map[string]int 2376 2377 whitespace: 2378 # Enforces newlines (or comments) after every multi-line if statement. 2379 # Default: false 2380 multi-if: true 2381 # Enforces newlines (or comments) after every multi-line function signature. 2382 # Default: false 2383 multi-func: true 2384 2385 wrapcheck: 2386 # An array of strings that specify substrings of signatures to ignore. 2387 # If this set, it will override the default set of ignored signatures. 2388 # See https://github.com/tomarrell/wrapcheck#configuration for more information. 2389 # Default: [".Errorf(", "errors.New(", "errors.Unwrap(", "errors.Join(", ".Wrap(", ".Wrapf(", ".WithMessage(", ".WithMessagef(", ".WithStack("] 2390 ignoreSigs: 2391 - .Errorf( 2392 - errors.New( 2393 - errors.Unwrap( 2394 - errors.Join( 2395 - .Wrap( 2396 - .Wrapf( 2397 - .WithMessage( 2398 - .WithMessagef( 2399 - .WithStack( 2400 # An array of strings that specify regular expressions of signatures to ignore. 2401 # Default: [] 2402 ignoreSigRegexps: 2403 - \.New.*Error\( 2404 # An array of strings that specify globs of packages to ignore. 2405 # Default: [] 2406 ignorePackageGlobs: 2407 - encoding/* 2408 - github.com/pkg/* 2409 # An array of strings that specify regular expressions of interfaces to ignore. 2410 # Default: [] 2411 ignoreInterfaceRegexps: 2412 - ^(?i)c(?-i)ach(ing|e) 2413 2414 wsl: 2415 # See https://github.com/bombsimon/wsl/blob/master/doc/configuration.md for documentation of available settings. 2416 # These are the defaults for `golangci-lint`. 2417 2418 # Do strict checking when assigning from append (x = append(x, y)). If 2419 # this is set to true - the append call must append either a variable 2420 # assigned, called or used on the line above. 2421 strict-append: true 2422 2423 # Allows assignments to be cuddled with variables used in calls on 2424 # line above and calls to be cuddled with assignments of variables 2425 # used in call on line above. 2426 allow-assign-and-call: true 2427 2428 # Allows assignments to be cuddled with anything. 2429 allow-assign-and-anything: false 2430 2431 # Allows cuddling to assignments even if they span over multiple lines. 2432 allow-multiline-assign: true 2433 2434 # If the number of lines in a case block is equal to or lager than this 2435 # number, the case *must* end white a newline. 2436 force-case-trailing-whitespace: 0 2437 2438 # Allow blocks to end with comments. 2439 allow-trailing-comment: false 2440 2441 # Allow multiple comments in the beginning of a block separated with newline. 2442 allow-separated-leading-comment: false 2443 2444 # Allow multiple var/declaration statements to be cuddled. 2445 allow-cuddle-declarations: false 2446 2447 # A list of call idents that everything can be cuddled with. 2448 # Defaults to calls looking like locks. 2449 allow-cuddle-with-calls: [ "Lock", "RLock" ] 2450 2451 # AllowCuddleWithRHS is a list of right hand side variables that is allowed 2452 # to be cuddled with anything. Defaults to assignments or calls looking 2453 # like unlocks. 2454 allow-cuddle-with-rhs: [ "Unlock", "RUnlock" ] 2455 2456 # Causes an error when an If statement that checks an error variable doesn't 2457 # cuddle with the assignment of that variable. 2458 force-err-cuddling: false 2459 2460 # When force-err-cuddling is enabled this is a list of names 2461 # used for error variables to check for in the conditional. 2462 error-variable-names: [ "err" ] 2463 2464 # Causes an error if a short declaration (:=) cuddles with anything other than 2465 # another short declaration. 2466 # This logic overrides force-err-cuddling among others. 2467 force-short-decl-cuddling: false 2468 2469 # The custom section can be used to define linter plugins to be loaded at runtime. 2470 # See README documentation for more info. 2471 custom: 2472 # Each custom linter should have a unique name. 2473 example: 2474 # The plugin type. 2475 # It can be `goplugin` or `module`. 2476 # Default: goplugin 2477 type: module 2478 # The path to the plugin *.so. Can be absolute or local. 2479 # Required for each custom linter. 2480 path: /path/to/example.so 2481 # The description of the linter. 2482 # Optional. 2483 description: This is an example usage of a plugin linter. 2484 # Intended to point to the repo location of the linter. 2485 # Optional. 2486 original-url: github.com/golangci/example-linter 2487 # Plugins settings/configuration. 2488 # Only work with plugin based on `linterdb.PluginConstructor`. 2489 # Optional. 2490 settings: 2491 foo: bar 2492 2493 2494 linters: 2495 # Disable all linters. 2496 # Default: false 2497 disable-all: true 2498 # Enable specific linter 2499 # https://golangci-lint.run/usage/linters/#enabled-by-default 2500 enable: 2501 - asasalint 2502 - asciicheck 2503 - bidichk 2504 - bodyclose 2505 - canonicalheader 2506 - containedctx 2507 - contextcheck 2508 - copyloopvar 2509 - cyclop 2510 - decorder 2511 - depguard 2512 - dogsled 2513 - dupl 2514 - dupword 2515 - durationcheck 2516 - err113 2517 - errcheck 2518 - errchkjson 2519 - errname 2520 - errorlint 2521 - execinquery 2522 - exhaustive 2523 - exhaustruct 2524 - exportloopref 2525 - fatcontext 2526 - forbidigo 2527 - forcetypeassert 2528 - funlen 2529 - gci 2530 - ginkgolinter 2531 - gocheckcompilerdirectives 2532 - gochecknoglobals 2533 - gochecknoinits 2534 - gochecksumtype 2535 - gocognit 2536 - goconst 2537 - gocritic 2538 - gocyclo 2539 - godot 2540 - godox 2541 - gofmt 2542 - gofumpt 2543 - goheader 2544 - goimports 2545 - gomoddirectives 2546 - gomodguard 2547 - goprintffuncname 2548 - gosec 2549 - gosimple 2550 - gosmopolitan 2551 - govet 2552 - grouper 2553 - importas 2554 - inamedparam 2555 - ineffassign 2556 - interfacebloat 2557 - intrange 2558 - ireturn 2559 - lll 2560 - loggercheck 2561 - maintidx 2562 - makezero 2563 - mirror 2564 - misspell 2565 - mnd 2566 - musttag 2567 - nakedret 2568 - nestif 2569 - nilerr 2570 - nilnil 2571 - nlreturn 2572 - noctx 2573 - nolintlint 2574 - nonamedreturns 2575 - nosprintfhostport 2576 - paralleltest 2577 - perfsprint 2578 - prealloc 2579 - predeclared 2580 - promlinter 2581 - protogetter 2582 - reassign 2583 - revive 2584 - rowserrcheck 2585 - sloglint 2586 - spancheck 2587 - sqlclosecheck 2588 - staticcheck 2589 - stylecheck 2590 - tagalign 2591 - tagliatelle 2592 - tenv 2593 - testableexamples 2594 - testifylint 2595 - testpackage 2596 - thelper 2597 - tparallel 2598 - typecheck 2599 - unconvert 2600 - unparam 2601 - unused 2602 - usestdlibvars 2603 - varnamelen 2604 - wastedassign 2605 - whitespace 2606 - wrapcheck 2607 - wsl 2608 - zerologlint 2609 2610 # Enable all available linters. 2611 # Default: false 2612 enable-all: true 2613 # Disable specific linter 2614 # https://golangci-lint.run/usage/linters/#disabled-by-default 2615 disable: 2616 - asasalint 2617 - asciicheck 2618 - bidichk 2619 - bodyclose 2620 - canonicalheader 2621 - containedctx 2622 - contextcheck 2623 - copyloopvar 2624 - cyclop 2625 - decorder 2626 - depguard 2627 - dogsled 2628 - dupl 2629 - dupword 2630 - durationcheck 2631 - err113 2632 - errcheck 2633 - errchkjson 2634 - errname 2635 - errorlint 2636 - execinquery 2637 - exhaustive 2638 - exhaustruct 2639 - exportloopref 2640 - fatcontext 2641 - forbidigo 2642 - forcetypeassert 2643 - funlen 2644 - gci 2645 - ginkgolinter 2646 - gocheckcompilerdirectives 2647 - gochecknoglobals 2648 - gochecknoinits 2649 - gochecksumtype 2650 - gocognit 2651 - goconst 2652 - gocritic 2653 - gocyclo 2654 - godot 2655 - godox 2656 - gofmt 2657 - gofumpt 2658 - goheader 2659 - goimports 2660 - gomoddirectives 2661 - gomodguard 2662 - goprintffuncname 2663 - gosec 2664 - gosimple 2665 - gosmopolitan 2666 - govet 2667 - grouper 2668 - importas 2669 - inamedparam 2670 - ineffassign 2671 - interfacebloat 2672 - intrange 2673 - ireturn 2674 - lll 2675 - loggercheck 2676 - maintidx 2677 - makezero 2678 - mirror 2679 - misspell 2680 - mnd 2681 - musttag 2682 - nakedret 2683 - nestif 2684 - nilerr 2685 - nilnil 2686 - nlreturn 2687 - noctx 2688 - nolintlint 2689 - nonamedreturns 2690 - nosprintfhostport 2691 - paralleltest 2692 - perfsprint 2693 - prealloc 2694 - predeclared 2695 - promlinter 2696 - protogetter 2697 - reassign 2698 - revive 2699 - rowserrcheck 2700 - sloglint 2701 - spancheck 2702 - sqlclosecheck 2703 - staticcheck 2704 - stylecheck 2705 - tagalign 2706 - tagliatelle 2707 - tenv 2708 - testableexamples 2709 - testifylint 2710 - testpackage 2711 - thelper 2712 - tparallel 2713 - typecheck 2714 - unconvert 2715 - unparam 2716 - unused 2717 - usestdlibvars 2718 - varnamelen 2719 - wastedassign 2720 - whitespace 2721 - wrapcheck 2722 - wsl 2723 - zerologlint 2724 - deadcode # Deprecated 2725 - exhaustivestruct # Deprecated 2726 - golint # Deprecated 2727 - ifshort # Deprecated 2728 - interfacer # Deprecated 2729 - maligned # Deprecated 2730 - gomnd # Deprecated 2731 - nosnakecase # Deprecated 2732 - scopelint # Deprecated 2733 - structcheck # Deprecated 2734 - varcheck # Deprecated 2735 2736 # Enable presets. 2737 # https://golangci-lint.run/usage/linters 2738 # Default: [] 2739 presets: 2740 - bugs 2741 - comment 2742 - complexity 2743 - error 2744 - format 2745 - import 2746 - metalinter 2747 - module 2748 - performance 2749 - sql 2750 - style 2751 - test 2752 - unused 2753 2754 # Enable only fast linters from enabled linters set (first run won't be fast) 2755 # Default: false 2756 fast: true 2757 2758 2759 issues: 2760 # List of regexps of issue texts to exclude. 2761 # 2762 # But independently of this option we use default exclude patterns, 2763 # it can be disabled by `exclude-use-default: false`. 2764 # To list all excluded by default patterns execute `golangci-lint run --help` 2765 # 2766 # Default: https://golangci-lint.run/usage/false-positives/#default-exclusions 2767 exclude: 2768 - abcdef 2769 2770 # Excluding configuration per-path, per-linter, per-text and per-source 2771 exclude-rules: 2772 # Exclude some linters from running on tests files. 2773 - path: _test\.go 2774 linters: 2775 - gocyclo 2776 - errcheck 2777 - dupl 2778 - gosec 2779 2780 # Run some linter only for test files by excluding its issues for everything else. 2781 - path-except: _test\.go 2782 linters: 2783 - forbidigo 2784 2785 # Exclude known linters from partially hard-vendored code, 2786 # which is impossible to exclude via `nolint` comments. 2787 # `/` will be replaced by current OS file path separator to properly work on Windows. 2788 - path: internal/hmac/ 2789 text: "weak cryptographic primitive" 2790 linters: 2791 - gosec 2792 2793 # Exclude some `staticcheck` messages. 2794 - linters: 2795 - staticcheck 2796 text: "SA9003:" 2797 2798 # Exclude `lll` issues for long lines with `go:generate`. 2799 - linters: 2800 - lll 2801 source: "^//go:generate " 2802 2803 # Independently of option `exclude` we use default exclude patterns, 2804 # it can be disabled by this option. 2805 # To list all excluded by default patterns execute `golangci-lint run --help`. 2806 # Default: true 2807 exclude-use-default: false 2808 2809 # If set to true, `exclude` and `exclude-rules` regular expressions become case-sensitive. 2810 # Default: false 2811 exclude-case-sensitive: false 2812 2813 # Which dirs to exclude: issues from them won't be reported. 2814 # Can use regexp here: `generated.*`, regexp is applied on full path, 2815 # including the path prefix if one is set. 2816 # Default dirs are skipped independently of this option's value (see exclude-dirs-use-default). 2817 # "/" will be replaced by current OS file path separator to properly work on Windows. 2818 # Default: [] 2819 exclude-dirs: 2820 - src/external_libs 2821 - autogenerated_by_my_lib 2822 2823 # Enables exclude of directories: 2824 # - vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ 2825 # Default: true 2826 exclude-dirs-use-default: false 2827 2828 # Which files to exclude: they will be analyzed, but issues from them won't be reported. 2829 # There is no need to include all autogenerated files, 2830 # we confidently recognize autogenerated files. 2831 # If it's not, please let us know. 2832 # "/" will be replaced by current OS file path separator to properly work on Windows. 2833 # Default: [] 2834 exclude-files: 2835 - ".*\\.my\\.go$" 2836 - lib/bad.go 2837 2838 # To follow strictly the Go generated file convention. 2839 # 2840 # If set to true, source files that have lines matching only the following regular expression will be excluded: 2841 # `^// Code generated .* DO NOT EDIT\.$` 2842 # This line must appear before the first non-comment, non-blank text in the file. 2843 # https://go.dev/s/generatedcode 2844 # 2845 # By default, a lax pattern is applied: 2846 # sources are excluded if they contain lines `autogenerated file`, `code generated`, `do not edit`, etc. 2847 # Default: false 2848 exclude-generated-strict: true 2849 2850 # The list of ids of default excludes to include or disable. 2851 # https://golangci-lint.run/usage/false-positives/#default-exclusions 2852 # Default: [] 2853 include: 2854 - EXC0001 2855 - EXC0002 2856 - EXC0003 2857 - EXC0004 2858 - EXC0005 2859 - EXC0006 2860 - EXC0007 2861 - EXC0008 2862 - EXC0009 2863 - EXC0010 2864 - EXC0011 2865 - EXC0012 2866 - EXC0013 2867 - EXC0014 2868 - EXC0015 2869 2870 # Maximum issues count per one linter. 2871 # Set to 0 to disable. 2872 # Default: 50 2873 max-issues-per-linter: 0 2874 2875 # Maximum count of issues with the same text. 2876 # Set to 0 to disable. 2877 # Default: 3 2878 max-same-issues: 0 2879 2880 # Show only new issues: if there are unstaged changes or untracked files, 2881 # only those changes are analyzed, else only changes in HEAD~ are analyzed. 2882 # It's a super-useful option for integration of golangci-lint into existing large codebase. 2883 # It's not practical to fix all existing issues at the moment of integration: 2884 # much better don't allow issues in new code. 2885 # 2886 # Default: false 2887 new: true 2888 2889 # Show only new issues created after git revision `REV`. 2890 # Default: "" 2891 new-from-rev: HEAD 2892 2893 # Show only new issues created in git patch with set file path. 2894 # Default: "" 2895 new-from-patch: path/to/patch/file 2896 2897 # Fix found issues (if it's supported by the linter). 2898 # Default: false 2899 fix: true 2900 2901 # Show issues in any part of update files (requires new-from-rev or new-from-patch). 2902 # Default: false 2903 whole-files: true 2904 2905 severity: 2906 # Set the default severity for issues. 2907 # 2908 # If severity rules are defined and the issues do not match or no severity is provided to the rule 2909 # this will be the default severity applied. 2910 # Severities should match the supported severity names of the selected out format. 2911 # - Code climate: https://docs.codeclimate.com/docs/issues#issue-severity 2912 # - Checkstyle: https://checkstyle.sourceforge.io/property_types.html#SeverityLevel 2913 # - GitHub: https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message 2914 # - TeamCity: https://www.jetbrains.com/help/teamcity/service-messages.html#Inspection+Instance 2915 # 2916 # `@linter` can be used as severity value to keep the severity from linters (e.g. revive, gosec, ...) 2917 # 2918 # Default: "" 2919 default-severity: error 2920 2921 # If set to true `severity-rules` regular expressions become case-sensitive. 2922 # Default: false 2923 case-sensitive: true 2924 2925 # When a list of severity rules are provided, severity information will be added to lint issues. 2926 # Severity rules have the same filtering capability as exclude rules 2927 # except you are allowed to specify one matcher per severity rule. 2928 # 2929 # `@linter` can be used as severity value to keep the severity from linters (e.g. revive, gosec, ...) 2930 # 2931 # Only affects out formats that support setting severity information. 2932 # 2933 # Default: [] 2934 rules: 2935 - linters: 2936 - dupl 2937 severity: info