github.com/etecs-ru/ristretto@v0.9.1/.golangci.yml (about) 1 # This file contains all available configuration options 2 # with their default values (in comments). 3 4 # Options for analysis running. 5 run: 6 # The default concurrency value is the number of available CPU. 7 concurrency: 4 8 9 # Timeout for analysis, e.g. 30s, 5m. 10 # Default: 1m 11 timeout: 5m 12 13 # Exit code when at least one issue was found. 14 # Default: 1 15 issues-exit-code: 2 16 17 # Include test files or not. 18 # Default: true 19 tests: false 20 21 # List of build tags, all linters use it. 22 # Default: []. 23 build-tags: 24 25 # Which dirs to skip: issues from them won't be reported. 26 # Can use regexp here: `generated.*`, regexp is applied on full path. 27 # Default value is empty list, 28 # but default dirs are skipped independently of this option's value (see skip-dirs-use-default). 29 # "/" will be replaced by current OS file path separator to properly work on Windows. 30 skip-dirs: 31 - benchmarks 32 33 # Enables skipping of directories: 34 # - vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ 35 # Default: true 36 skip-dirs-use-default: false 37 38 # Which files to skip: they will be analyzed, but issues from them won't be reported. 39 # Default value is empty list, 40 # but there is no need to include all autogenerated files, 41 # we confidently recognize autogenerated files. 42 # If it's not please let us know. 43 # "/" will be replaced by current OS file path separator to properly work on Windows. 44 skip-files: 45 #- ".*\\.my\\.go$" 46 47 # If set we pass it to "go list -mod={option}". From "go help modules": 48 # If invoked with -mod=readonly, the go command is disallowed from the implicit 49 # automatic updating of go.mod described above. Instead, it fails when any changes 50 # to go.mod are needed. This setting is most useful to check that go.mod does 51 # not need updates, such as in a continuous integration and testing system. 52 # If invoked with -mod=vendor, the go command assumes that the vendor 53 # directory holds the correct copies of dependencies and ignores 54 # the dependency descriptions in go.mod. 55 # 56 # Allowed values: readonly|vendor|mod 57 # By default, it isn't set. 58 modules-download-mode: readonly 59 60 # Allow multiple parallel golangci-lint instances running. 61 # If false (default) - golangci-lint acquires file lock on start. 62 allow-parallel-runners: false 63 64 65 # output configuration options 66 output: 67 # Format: colored-line-number|line-number|json|tab|checkstyle|code-climate|junit-xml|github-actions 68 # 69 # Multiple can be specified by separating them by comma, output can be provided 70 # for each of them by separating format name and path by colon symbol. 71 # Output path can be either `stdout`, `stderr` or path to the file to write to. 72 # Example: "checkstyle:report.json,colored-line-number" 73 # 74 # Default: colored-line-number 75 # format: json 76 format: colored-line-number 77 78 # Print lines of code with issue. 79 # Default: true 80 print-issued-lines: true 81 82 # Print linter name in the end of issue text. 83 # Default: true 84 print-linter-name: true 85 86 # Make issues output unique by line. 87 # Default: true 88 uniq-by-line: false 89 90 # Add a prefix to the output file references. 91 # Default is no prefix. 92 path-prefix: "" 93 94 # Sort results by: filepath, line and column. 95 sort-results: true 96 97 98 # All available settings of specific linters. 99 linters-settings: 100 bidichk: 101 # The following configurations check for all mentioned invisible unicode runes. 102 # All runes are enabled by default. 103 left-to-right-embedding: false 104 right-to-left-embedding: false 105 pop-directional-formatting: false 106 left-to-right-override: false 107 right-to-left-override: false 108 left-to-right-isolate: false 109 right-to-left-isolate: false 110 first-strong-isolate: false 111 pop-directional-isolate: false 112 113 cyclop: 114 # The maximal code complexity to report. 115 max-complexity: 10 116 # The maximal average package complexity. 117 # If it's higher than 0.0 (float) the check is enabled 118 # Default: 0.0 119 package-average: 0.5 120 # Should ignore tests. 121 # Default: false 122 skip-tests: true 123 124 decorder: 125 # Required order of `type`, `const`, `var` and `func` declarations inside a file. 126 # Default: types before constants before variables before functions. 127 dec-order: 128 - type 129 - const 130 - var 131 - func 132 133 # If true, order of declarations is not checked at all. 134 # Default: true (disabled) 135 disable-dec-order-check: false 136 137 # If true, `init` func can be anywhere in file (must not be declared before all other functions). 138 # Default: true (disabled) 139 disable-init-func-first-check: false 140 141 # If true, multiple global `type`, `const` and `var` declarations are allowed. 142 # Default: true (disabled) 143 disable-dec-num-check: false 144 145 depguard: 146 # Kind of list is passed in. 147 # Allowed values: allowlist|denylist 148 # Default: denylist 149 list-type: allowlist 150 151 # Check the list against standard lib. 152 # Default: false 153 include-go-root: true 154 155 # A list of packages for the list type specified. 156 # Default: [] 157 packages: 158 - log 159 - errors 160 161 # A list of packages for the list type specified. 162 # Specify an error message to output when a denied package is used. 163 # Default: [] 164 packages-with-error-message: 165 166 # Create additional guards that follow the same configuration pattern. 167 # Results from all guards are aggregated together. 168 additional-guards: 169 - list-type: denylist 170 packages: 171 - github.com/pkg/errors 172 - list-type: denylist 173 include-go-root: false 174 packages: 175 - github.com/stretchr/testify 176 # Specify rules by which the linter ignores certain files for consideration. 177 ignore-file-rules: 178 - "**/*_test.go" 179 - "**/mock/**/*.go" 180 181 dogsled: 182 # Checks assignments with too many blank identifiers. 183 # Default: 2 184 max-blank-identifiers: 3 185 186 dupl: 187 # Tokens count to trigger issue. 188 # Default: 150 189 threshold: 100 190 191 errcheck: 192 # Report about not checking of errors in type assertions: `a := b.(MyStruct)`. 193 # Such cases aren't reported by default. 194 # Default: false 195 check-type-assertions: true 196 197 # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`. 198 # Such cases aren't reported by default. 199 # Default: false 200 check-blank: true 201 202 # List of functions to exclude from checking, where each entry is a single function to exclude. 203 # See https://github.com/kisielk/errcheck#excluding-functions for details. 204 exclude-functions: 205 - io.Copy(*bytes.Buffer) 206 - io.Copy(os.Stdout) 207 208 errchkjson: 209 # With check-error-free-encoding set to true, errchkjson does warn about errors 210 # from json encoding functions that are safe to be ignored, 211 # because they are not possible to happen. 212 # 213 # if check-error-free-encoding is set to true and errcheck linter is enabled, 214 # it is recommended to add the following exceptions to prevent from false positives: 215 # 216 # linters-settings: 217 # errcheck: 218 # exclude-functions: 219 # - encoding/json.Marshal 220 # - encoding/json.MarshalIndent 221 # 222 # Default: false 223 check-error-free-encoding: true 224 225 # Issue on struct encoding that doesn't have exported fields. 226 # Default: false 227 report-no-exported: false 228 229 errorlint: 230 # Check whether fmt.Errorf uses the %w verb for formatting errors. 231 # See the https://github.com/polyfloyd/go-errorlint for caveats. 232 # Default: true 233 errorf: false 234 # Check for plain type assertions and type switches. 235 # Default: true 236 asserts: false 237 # Check for plain error comparisons. 238 # Default: true 239 comparison: false 240 241 exhaustive: 242 # Check switch statements in generated files also. 243 # Default: false 244 check-generated: true 245 # Presence of "default" case in switch statements satisfies exhaustiveness, 246 # even if all enum members are not listed. 247 # Default: false 248 default-signifies-exhaustive: true 249 # Enum members matching the supplied regex do not have to be listed in 250 # switch statements to satisfy exhaustiveness. 251 # Default: "" 252 ignore-enum-members: "Example.+" 253 # Consider enums only in package scopes, not in inner scopes. 254 # Default: false 255 package-scope-only: true 256 257 exhaustivestruct: 258 # Struct Patterns is list of expressions to match struct packages and names. 259 # The struct packages have the form `example.com/package.ExampleStruct`. 260 # The matching patterns can use matching syntax from https://pkg.go.dev/path#Match. 261 # If this list is empty, all structs are tested. 262 struct-patterns: 263 - '*.Test' 264 - 'example.com/package.ExampleStruct' 265 266 forbidigo: 267 # Forbid the following identifiers (list of regexp). 268 forbid: 269 - ^print.*$ 270 - 'fmt\.Print.*' 271 # Exclude godoc examples from forbidigo checks. 272 # Default: true 273 exclude_godoc_examples: false 274 275 funlen: 276 # Checks the number of lines in a function. 277 # If lower than 0, disable the check. 278 # Default: 60 279 lines: -1 280 # Checks the number of statements in a function. 281 # If lower than 0, disable the check. 282 # Default: 40 283 statements: -1 284 285 gci: 286 # Put imports beginning with prefix after 3rd-party packages. 287 # Only support one prefix. 288 # If not set, use `goimports.local-prefixes`. 289 local-prefixes: github.com/etecs-ru/ristretto 290 291 gocognit: 292 # Minimal code complexity to report 293 # Default: 30 (but we recommend 10-20) 294 min-complexity: 10 295 296 goconst: 297 # Minimal length of string constant. 298 # Default: 3 299 min-len: 2 300 # Minimum occurrences of constant string count to trigger issue. 301 # Default: 3 302 min-occurrences: 2 303 # Ignore test files. 304 # Default: false 305 ignore-tests: true 306 # Look for existing constants matching the values. 307 # Default: true 308 match-constant: false 309 # Search also for duplicated numbers. 310 # Default: false 311 numbers: true 312 # Minimum value, only works with goconst.numbers 313 # Default: 3 314 min: 2 315 # Maximum value, only works with goconst.numbers 316 # Default: 3 317 max: 2 318 # Ignore when constant is not used as function argument. 319 # Default: true 320 ignore-calls: false 321 322 gocritic: 323 # Which checks should be enabled; can't be combined with 'disabled-checks'. 324 # See https://go-critic.github.io/overview#checks-overview. 325 # To check which checks are enabled run `GL_DEBUG=gocritic golangci-lint run`. 326 # By default, list of stable checks is used. 327 #enabled-checks: 328 329 # Which checks should be disabled; can't be combined with 'enabled-checks'. 330 # Default: [] 331 disabled-checks: 332 333 # Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint run` to see all tags and checks. 334 # See https://github.com/go-critic/go-critic#usage -> section "Tags". 335 # Default: [] 336 enabled-tags: 337 - diagnostic 338 - style 339 - performance 340 - experimental 341 - opinionated 342 disabled-tags: 343 344 345 # Settings passed to gocritic. 346 # The settings key is the name of a supported gocritic checker. 347 # The list of supported checkers can be find in https://go-critic.github.io/overview. 348 settings: 349 # Must be valid enabled check name. 350 captLocal: 351 # Whether to restrict checker to params only. 352 # Default: true 353 paramsOnly: false 354 elseif: 355 # Whether to skip balanced if-else pairs. 356 # Default: true 357 skipBalanced: false 358 hugeParam: 359 # Size in bytes that makes the warning trigger. 360 # Default: 80 361 sizeThreshold: 70 362 nestingReduce: 363 # Min number of statements inside a branch to trigger a warning. 364 # Default: 5 365 bodyWidth: 4 366 rangeExprCopy: 367 # Size in bytes that makes the warning trigger. 368 # Default: 512 369 sizeThreshold: 516 370 # Whether to check test functions 371 # Default: true 372 skipTestFuncs: false 373 rangeValCopy: 374 # Size in bytes that makes the warning trigger. 375 # Default: 128 376 sizeThreshold: 32 377 # Whether to check test functions. 378 # Default: true 379 skipTestFuncs: false 380 ruleguard: 381 # Enable debug to identify which 'Where' condition was rejected. 382 # The value of the parameter is the name of a function in a ruleguard file. 383 # 384 # When a rule is evaluated: 385 # If: 386 # The Match() clause is accepted; and 387 # One of the conditions in the Where() clause is rejected, 388 # Then: 389 # ruleguard prints the specific Where() condition that was rejected. 390 # 391 # The flag is passed to the ruleguard 'debug-group' argument. 392 debug: 'emptyDecl' 393 # Deprecated, use 'failOn' param. 394 # If set to true, identical to failOn='all', otherwise failOn='' 395 failOnError: false 396 # Determines the behavior when an error occurs while parsing ruleguard files. 397 # If flag is not set, log error and skip rule files that contain an error. 398 # If flag is set, the value must be a comma-separated list of error conditions. 399 # - 'all': fail on all errors. 400 # - 'import': ruleguard rule imports a package that cannot be found. 401 # - 'dsl': gorule file does not comply with the ruleguard DSL. 402 failOn: dsl 403 # Comma-separated list of file paths containing ruleguard rules. 404 # If a path is relative, it is relative to the directory where the golangci-lint command is executed. 405 # The special '${configDir}' variable is substituted with the absolute directory containing the golangci config file. 406 # Glob patterns such as 'rules-*.go' may be specified. 407 #rules: '${configDir}/ruleguard/rules-*.go,${configDir}/myrule1.go' 408 tooManyResultsChecker: 409 # Maximum number of results. 410 # Default: 5 411 maxResults: 10 412 truncateCmp: 413 # Whether to skip int/uint/uintptr types. 414 # Default: true 415 skipArchDependent: false 416 underef: 417 # Whether to skip (*x).method() calls where x is a pointer receiver. 418 # Default: true 419 skipRecvDeref: false 420 unnamedResult: 421 # Whether to check exported functions. 422 checkExported: true 423 424 gocyclo: 425 # Minimal code complexity to report. 426 # Default: 30 (but we recommend 10-20) 427 min-complexity: 10 428 429 godot: 430 # Comments to be checked: `declarations`, `toplevel`, or `all`. 431 # Default: declarations 432 scope: toplevel 433 # List of regexps for excluding particular comment lines from check. 434 exclude: 435 # Exclude todo and fixme comments. 436 - "^fixme:" 437 - "^todo:" 438 # Check that each sentence ends with a period. 439 # Default: true 440 period: false 441 # Check that each sentence starts with a capital letter. 442 # Default: false 443 capital: true 444 445 godox: 446 # Report any comments starting with keywords, this is useful for TODO or FIXME comments that 447 # might be left in the code accidentally and should be resolved before merging. 448 # Default: TODO, BUG, and FIXME. 449 keywords: 450 - NOTE 451 - OPTIMIZE # marks code that should be optimized before merging 452 - HACK # marks hack-around that should be removed before merging 453 454 gofmt: 455 # Simplify code: gofmt with `-s` option. 456 # Default: true 457 simplify: false 458 459 gofumpt: 460 # Select the Go version to target. 461 # Default: 1.15 462 lang-version: "1.17" 463 464 # Choose whether to use the extra rules. 465 # Default: false 466 extra-rules: true 467 468 469 goimports: 470 # Put imports beginning with prefix after 3rd-party packages. 471 # It's a comma-separated list of prefixes. 472 local-prefixes: github.com/etecs-ru/ristretto 473 474 golint: 475 # Minimal confidence for issues. 476 # Default: 0.8 477 min-confidence: 0.7 478 479 gomnd: 480 # List of enabled checks, see https://github.com/tommy-muehle/go-mnd/#checks for description. 481 checks: 482 - argument 483 - case 484 - condition 485 - operation 486 - return 487 - assign 488 # List of numbers to exclude from analysis. 489 # The numbers should be written as string. 490 # Values always ignored: "1", "1.0", "0" and "0.0" 491 ignored-numbers: 492 - '0666' 493 - '0755' 494 - '42' 495 # List of file patterns to exclude from analysis. 496 # Values always ignored: `.+_test.go` 497 ignored-files: 498 - 'magic1_.*.go' 499 # List of function patterns to exclude from analysis. 500 # Values always ignored: `time.Time` 501 ignored-functions: 502 - 'math.*' 503 - 'http.StatusText' 504 505 gomoddirectives: 506 # Allow local `replace` directives. 507 replace-local: false 508 # List of allowed `replace` directives. 509 # Default: [] 510 replace-allow-list: 511 - launchpad.net/gocheck 512 # Allow to not explain why the version has been retracted in the `retract` directives. 513 # Default: false 514 retract-allow-no-explanation: false 515 # Forbid the use of the `exclude` directives. 516 # Default: false 517 exclude-forbidden: false 518 519 gomodguard: 520 allowed: 521 # List of allowed modules. 522 modules: 523 - gopkg.in/yaml.v2 524 # List of allowed module domains. 525 domains: 526 - golang.org 527 blocked: 528 # List of blocked modules. 529 modules: 530 # Blocked module. 531 - github.com/uudashr/go-module: 532 # Recommended modules that should be used instead. (Optional) 533 recommendations: 534 - golang.org/x/mod 535 # Reason why the recommended module should be used. (Optional) 536 reason: "`mod` is the official go.mod parser library." 537 # List of blocked module version constraints. 538 versions: 539 # Blocked module with version constraint. 540 - github.com/mitchellh/go-homedir: 541 # Version constraint, see https://github.com/Masterminds/semver#basic-comparisons. 542 version: "< 1.1.0" 543 # Reason why the version constraint exists. (Optional) 544 reason: "testing if blocked version constraint works." 545 # Set to true to raise lint issues for packages that are loaded from a local path via replace directive. 546 local_replace_directives: false 547 548 gosimple: 549 go: "1.17" 550 # https://staticcheck.io/docs/options#checks 551 checks: [ "all" ] 552 553 gosec: 554 # To select a subset of rules to run. 555 # Available rules: https://github.com/securego/gosec#available-rules 556 includes: 557 - G101 558 - G102 559 - G103 560 - G104 561 - G106 562 - G107 563 - G108 564 - G109 565 - G110 566 - G201 567 - G202 568 - G203 569 - G204 570 - G301 571 - G302 572 - G303 573 - G304 574 - G305 575 - G306 576 - G307 577 - G401 578 - G402 579 - G403 580 - G404 581 - G501 582 - G502 583 - G503 584 - G504 585 - G505 586 - G601 587 588 # To specify a set of rules to explicitly exclude. 589 # Available rules: https://github.com/securego/gosec#available-rules 590 excludes: 591 592 593 # Exclude generated files 594 # Default: false 595 exclude-generated: true 596 597 # Filter out the issues with a lower severity than the given value. 598 # Valid options are: low, medium, high. 599 # Default: low 600 severity: medium 601 602 # Filter out the issues with a lower confidence than the given value. 603 # Valid options are: low, medium, high. 604 # Default: low 605 confidence: medium 606 607 # To specify the configuration of rules. 608 # The configuration of rules is not fully documented by gosec: 609 # https://github.com/securego/gosec#configuration 610 # https://github.com/securego/gosec/blob/569328eade2ccbad4ce2d0f21ee158ab5356a5cf/rules/rulelist.go#L60-L102 611 config: 612 G306: "0600" 613 G101: 614 pattern: "(?i)example" 615 ignore_entropy: false 616 entropy_threshold: "80.0" 617 per_char_threshold: "3.0" 618 truncate: "32" 619 620 govet: 621 # Report about shadowed variables. 622 # Default: false 623 check-shadowing: true 624 625 # Settings per analyzer. 626 settings: 627 # Analyzer name, run `go tool vet help` to see all analyzers. 628 printf: 629 # Run `go tool vet help printf` to see available settings for `printf` analyzer. 630 funcs: 631 632 633 # Enable analyzers by name. 634 # Run `go tool vet help` to see all analyzers. 635 enable: 636 - asmdecl 637 - assign 638 - atomic 639 - atomicalign 640 - bools 641 - buildtag 642 - cgocall 643 - composites 644 - copylocks 645 - deepequalerrors 646 - errorsas 647 - fieldalignment 648 - findcall 649 - framepointer 650 - httpresponse 651 - ifaceassert 652 - loopclosure 653 - lostcancel 654 - nilfunc 655 - nilness 656 - printf 657 - reflectvaluecompare 658 - shadow 659 - shift 660 - sigchanyzer 661 - sortslice 662 - stdmethods 663 - stringintconv 664 - structtag 665 - testinggoroutine 666 - tests 667 - unmarshal 668 - unreachable 669 - unsafeptr 670 - unusedresult 671 - unusedwrite 672 673 # Enable all analyzers. 674 # Default: false 675 # enable-all: true 676 # Disable analyzers by name. 677 # Run `go tool vet help` to see all analyzers. 678 disable: 679 680 grouper: 681 # Require the use of a single global 'const' declaration only. 682 # Default: false 683 const-require-single-const: true 684 # Require the use of grouped global 'const' declarations. 685 # Default: false 686 const-require-grouping: true 687 688 # Require the use of a single 'import' declaration only. 689 # Default: false 690 import-require-single-import: true 691 # Require the use of grouped 'import' declarations. 692 # Default: false 693 import-require-grouping: true 694 695 # Require the use of a single global 'type' declaration only. 696 # Default: false 697 type-require-single-type: true 698 # Require the use of grouped global 'type' declarations. 699 # Default: false 700 type-require-grouping: true 701 702 # Require the use of a single global 'var' declaration only. 703 # Default: false 704 var-require-single-var: true 705 # Require the use of grouped global 'var' declarations. 706 # Default: false 707 var-require-grouping: true 708 709 ifshort: 710 # Maximum length of variable declaration measured in number of lines, after which linter won't suggest using short syntax. 711 # Has higher priority than max-decl-chars. 712 # Default: 1 713 max-decl-lines: 2 714 # Maximum length of variable declaration measured in number of characters, after which linter won't suggest using short syntax. 715 # Default: 30 716 max-decl-chars: 40 717 718 importas: 719 # Do not allow unaliased imports of aliased packages. 720 # Default: false 721 no-unaliased: true 722 # Do not allow non-required aliases. 723 # Default: false 724 no-extra-aliases: true 725 # List of aliases 726 alias: 727 - pkg: log 728 alias: 729 - pkg: errors 730 alias: 731 732 733 ireturn: 734 # ireturn allows using `allow` and `reject` settings at the same time. 735 # Both settings are lists of the keywords and regular expressions matched to interface or package names. 736 # keywords: 737 # - `empty` for `interface{}` 738 # - `error` for errors 739 # - `stdlib` for standard library 740 # - `anon` for anonymous interfaces 741 742 # By default, it allows using errors, empty interfaces, anonymous interfaces, 743 # and interfaces provided by the standard library. 744 allow: 745 - anon 746 - error 747 - empty 748 - stdlib 749 # You can specify idiomatic endings for interface 750 - (or|er)$ 751 752 753 lll: 754 # Max line length, lines longer will be reported. 755 # '\t' is counted as 1 character by default, and can be changed with the tab-width option. 756 # Default: 120. 757 line-length: 120 758 # Tab width in spaces. 759 # Default: 1 760 tab-width: 1 761 762 maintidx: 763 # Show functions with maintainability index lower than N. 764 # A high index indicates better maintainability (it's kind of the opposite of complexity). 765 # Default: 20 766 under: 100 767 768 makezero: 769 # Allow only slices initialized with a length of zero. 770 # Default: false 771 always: false 772 773 maligned: 774 # Print struct with more effective memory layout or not. 775 # Default: false 776 suggest-new: true 777 778 misspell: 779 # Correct spellings using locale preferences for US or UK. 780 # Setting locale to US will correct the British spelling of 'colour' to 'color'. 781 # Default is to use a neutral variety of English. 782 locale: US 783 ignore-words: 784 - someword 785 786 nakedret: 787 # Make an issue if func has more lines of code than this setting, and it has naked returns. 788 # Default: 30 789 max-func-lines: 31 790 791 nestif: 792 # Minimal complexity of if statements to report. 793 # Default: 5 794 min-complexity: 4 795 796 nilnil: 797 # Checks that there is no simultaneous return of `nil` error and an invalid value. 798 # Default: ptr, func, iface, map, chan 799 checked-types: 800 - ptr 801 - func 802 - iface 803 - map 804 - chan 805 806 nlreturn: 807 # Size of the block (including return statement that is still "OK") 808 # so no return split required. 809 # Default: 1 810 block-size: 2 811 812 nolintlint: 813 # Disable to ensure that all nolint directives actually have an effect. 814 # Default: false 815 allow-unused: true 816 # Disable to ensure that nolint directives don't have a leading space. 817 # Default: true 818 allow-leading-space: false 819 # Exclude following linters from requiring an explanation. 820 # Default: [] 821 allow-no-explanation: [ ] 822 # Enable to require an explanation of nonzero length after each nolint directive. 823 # Default: false 824 require-explanation: true 825 # Enable to require nolint directives to mention the specific linter being suppressed. 826 # Default: false 827 require-specific: true 828 829 prealloc: 830 # IMPORTANT: we don't recommend using this linter before doing performance profiling. 831 # For most programs usage of prealloc will be a premature optimization. 832 833 # Report pre-allocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them. 834 # Default: true 835 simple: false 836 # Report pre-allocation suggestions on range loops. 837 # Default: true 838 range-loops: false 839 # Report pre-allocation suggestions on for loops. 840 # Default: false 841 for-loops: true 842 843 predeclared: 844 # Comma-separated list of predeclared identifiers to not report on. 845 # Default: "" 846 ignore: "new,int" 847 # Include method names and field names (i.e., qualified names) in checks. 848 # Default: false 849 q: true 850 851 promlinter: 852 # Promlinter cannot infer all metrics name in static analysis. 853 # Enable strict mode will also include the errors caused by failing to parse the args. 854 # Default: false 855 strict: true 856 # Please refer to https://github.com/yeya24/promlinter#usage for detailed usage. 857 disabled-linters: 858 - Help 859 - MetricUnits 860 - Counter 861 - HistogramSummaryReserved 862 - MetricTypeInName 863 - ReservedChars 864 - CamelCase 865 - UnitAbbreviations 866 867 revive: 868 # See https://github.com/mgechev/revive#available-rules for details. 869 ignore-generated-header: true 870 severity: warning 871 enable-all-rules: false 872 # confidence: 0.8 873 # error-code: 0 874 # warning-code: 0 875 rules: 876 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#add-constant 877 - name: add-constant 878 severity: warning 879 disabled: false 880 arguments: 881 - maxLitCount: "3" 882 allowStrs: '""' 883 allowInts: "0,1,2" 884 allowFloats: "0.0,0.,1.0,1.,2.0,2." 885 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#atomic 886 - name: atomic 887 severity: warning 888 disabled: false 889 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#banned-characters 890 - name: banned-characters 891 severity: warning 892 disabled: false 893 arguments: ["Ω","Σ","σ", "7"] 894 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#bare-return 895 - name: bare-return 896 severity: warning 897 disabled: false 898 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#blank-imports 899 - name: blank-imports 900 severity: warning 901 disabled: false 902 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#bool-literal-in-expr 903 - name: bool-literal-in-expr 904 severity: warning 905 disabled: false 906 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#call-to-gc 907 - name: call-to-gc 908 severity: warning 909 disabled: false 910 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#cognitive-complexity 911 - name: cognitive-complexity 912 severity: warning 913 disabled: false 914 arguments: [ 7 ] 915 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#confusing-naming 916 - name: confusing-naming 917 severity: warning 918 disabled: false 919 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#confusing-results 920 - name: confusing-results 921 severity: warning 922 disabled: false 923 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#constant-logical-expr 924 - name: constant-logical-expr 925 severity: warning 926 disabled: false 927 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#context-as-argument 928 - name: context-as-argument 929 severity: warning 930 disabled: false 931 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#context-keys-type 932 - name: context-keys-type 933 severity: warning 934 disabled: false 935 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#cyclomatic 936 - name: cyclomatic 937 severity: warning 938 disabled: false 939 arguments: [ 3 ] 940 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#deep-exit 941 - name: deep-exit 942 severity: warning 943 disabled: true # TODO: make false? 944 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#defer 945 - name: defer 946 severity: warning 947 disabled: false 948 arguments: 949 - [ "call-chain", "loop" ] 950 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#dot-imports 951 - name: dot-imports 952 severity: warning 953 disabled: false 954 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#duplicated-imports 955 - name: duplicated-imports 956 severity: warning 957 disabled: false 958 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#early-return 959 - name: early-return 960 severity: warning 961 disabled: false 962 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#empty-block 963 - name: empty-block 964 severity: warning 965 disabled: false 966 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#empty-lines 967 - name: empty-lines 968 severity: warning 969 disabled: false 970 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#error-naming 971 - name: error-naming 972 severity: warning 973 disabled: false 974 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#error-return 975 - name: error-return 976 severity: warning 977 disabled: false 978 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#error-strings 979 - name: error-strings 980 severity: warning 981 disabled: false 982 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#errorf 983 - name: errorf 984 severity: warning 985 disabled: false 986 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#exported 987 - name: exported 988 severity: warning 989 disabled: false 990 arguments: 991 - "checkPrivateReceivers" 992 - "sayRepetitiveInsteadOfStutters" 993 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#file-header 994 - name: file-header 995 severity: warning 996 disabled: false 997 arguments: 998 - This is the text that must appear at the top of source files. 999 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#flag-parameter 1000 - name: flag-parameter 1001 severity: warning 1002 disabled: false 1003 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#function-result-limit 1004 - name: function-result-limit 1005 severity: warning 1006 disabled: false 1007 arguments: [ 2 ] 1008 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#function-length 1009 - name: function-length 1010 severity: warning 1011 disabled: false 1012 arguments: [ 10, 0 ] 1013 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#get-return 1014 - name: get-return 1015 severity: warning 1016 disabled: false 1017 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#identical-branches 1018 - name: identical-branches 1019 severity: warning 1020 disabled: false 1021 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#if-return 1022 - name: if-return 1023 severity: warning 1024 disabled: false 1025 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#increment-decrement 1026 - name: increment-decrement 1027 severity: warning 1028 disabled: false 1029 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#indent-error-flow 1030 - name: indent-error-flow 1031 severity: warning 1032 disabled: false 1033 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#imports-blacklist 1034 - name: imports-blacklist 1035 severity: warning 1036 disabled: false 1037 arguments: 1038 - "crypto/md5" 1039 - "crypto/sha1" 1040 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#import-shadowing 1041 - name: import-shadowing 1042 severity: warning 1043 disabled: false 1044 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#line-length-limit 1045 - name: line-length-limit 1046 severity: warning 1047 disabled: false 1048 arguments: [ 110 ] 1049 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#max-public-structs 1050 - name: max-public-structs 1051 severity: warning 1052 disabled: false 1053 arguments: [ 3 ] 1054 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#modifies-parameter 1055 - name: modifies-parameter 1056 severity: warning 1057 disabled: false 1058 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#modifies-value-receiver 1059 - name: modifies-value-receiver 1060 severity: warning 1061 disabled: false 1062 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#nested-structs 1063 - name: nested-structs 1064 severity: warning 1065 disabled: false 1066 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#optimize-operands-order 1067 - name: optimize-operands-order 1068 severity: warning 1069 disabled: false 1070 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#package-comments 1071 - name: package-comments 1072 severity: warning 1073 disabled: false 1074 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#range 1075 - name: range 1076 severity: warning 1077 disabled: false 1078 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#range-val-in-closure 1079 - name: range-val-in-closure 1080 severity: warning 1081 disabled: false 1082 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#range-val-address 1083 - name: range-val-address 1084 severity: warning 1085 disabled: false 1086 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#receiver-naming 1087 - name: receiver-naming 1088 severity: warning 1089 disabled: false 1090 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#redefines-builtin-id 1091 - name: redefines-builtin-id 1092 severity: warning 1093 disabled: false 1094 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#string-of-int 1095 - name: string-of-int 1096 severity: warning 1097 disabled: false 1098 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#string-format 1099 - name: string-format 1100 severity: warning 1101 disabled: false 1102 arguments: 1103 - - 'core.WriteError[1].Message' 1104 - '/^([^A-Z]|$)/' 1105 - must not start with a capital letter 1106 - - 'fmt.Errorf[0]' 1107 - '/(^|[^\.!?])$/' 1108 - must not end in punctuation 1109 - - panic 1110 - '/^[^\n]*$/' 1111 - must not contain line breaks 1112 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#struct-tag 1113 - name: struct-tag 1114 severity: warning 1115 disabled: false 1116 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#superfluous-else 1117 - name: superfluous-else 1118 severity: warning 1119 disabled: false 1120 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#time-equal 1121 - name: time-equal 1122 severity: warning 1123 disabled: false 1124 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#time-naming 1125 - name: time-naming 1126 severity: warning 1127 disabled: false 1128 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#var-naming 1129 - name: var-naming 1130 severity: warning 1131 disabled: false 1132 arguments: 1133 - [ "ID" ] # AllowList 1134 - [ "VM" ] # DenyList 1135 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#var-declaration 1136 - name: var-declaration 1137 severity: warning 1138 disabled: false 1139 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unconditional-recursion 1140 - name: unconditional-recursion 1141 severity: warning 1142 disabled: false 1143 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unexported-naming 1144 - name: unexported-naming 1145 severity: warning 1146 disabled: false 1147 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unexported-return 1148 - name: unexported-return 1149 severity: warning 1150 disabled: false 1151 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unhandled-error 1152 - name: unhandled-error 1153 severity: warning 1154 disabled: false 1155 arguments: 1156 - "fmt.Printf" 1157 - "myFunction" 1158 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unnecessary-stmt 1159 - name: unnecessary-stmt 1160 severity: warning 1161 disabled: false 1162 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unreachable-code 1163 - name: unreachable-code 1164 severity: warning 1165 disabled: false 1166 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-parameter 1167 - name: unused-parameter 1168 severity: warning 1169 disabled: false 1170 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-receiver 1171 - name: unused-receiver 1172 severity: warning 1173 disabled: false 1174 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#useless-break 1175 - name: useless-break 1176 severity: warning 1177 disabled: false 1178 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#waitgroup-by-value 1179 - name: waitgroup-by-value 1180 severity: warning 1181 disabled: false 1182 1183 rowserrcheck: 1184 packages: 1185 - github.com/jmoiron/sqlx 1186 1187 staticcheck: 1188 # Select the Go version to target. 1189 # Default: 1.13 1190 go: "1.15" 1191 # https://staticcheck.io/docs/options#checks 1192 checks: [ "all" ] 1193 1194 stylecheck: 1195 # Select the Go version to target. 1196 # Default: 1.13 1197 go: "1.15" 1198 # https://staticcheck.io/docs/options#checks 1199 checks: [ "all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022" ] 1200 # https://staticcheck.io/docs/options#dot_import_whitelist 1201 dot-import-whitelist: 1202 - fmt 1203 # https://staticcheck.io/docs/options#initialisms 1204 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" ] 1205 # https://staticcheck.io/docs/options#http_status_code_whitelist 1206 http-status-code-whitelist: [ "200", "400", "404", "500" ] 1207 1208 tagliatelle: 1209 # Check the struck tag name case. 1210 case: 1211 # Use the struct field name to check the name of the struct tag. 1212 # Default: false 1213 use-field-name: true 1214 rules: 1215 # Any struct tag type can be used. 1216 # Support string case: `camel`, `pascal`, `kebab`, `snake`, `goCamel`, `goPascal`, `goKebab`, `goSnake`, `upper`, `lower` 1217 json: camel 1218 yaml: camel 1219 xml: camel 1220 bson: camel 1221 avro: snake 1222 mapstructure: kebab 1223 1224 tenv: 1225 # The option `all` will run against whole test files (`_test.go`) regardless of method/function signatures. 1226 # By default, only methods that take `*testing.T`, `*testing.B`, and `testing.TB` as arguments are checked. 1227 all: false 1228 1229 testpackage: 1230 # regexp pattern to skip files 1231 skip-regexp: (export|internal)_test\.go 1232 1233 thelper: 1234 # The following configurations enable all checks. 1235 # All checks are enabled by default. 1236 test: 1237 first: false 1238 name: false 1239 begin: false 1240 benchmark: 1241 first: false 1242 name: false 1243 begin: false 1244 tb: 1245 first: false 1246 name: false 1247 begin: false 1248 1249 unparam: 1250 # Inspect exported functions. 1251 # 1252 # Set to true if no external program/library imports your code. 1253 # XXX: if you enable this setting, unparam will report a lot of false-positives in text editors: 1254 # if it's called for subdir of a project it can't find external interfaces. All text editor integrations 1255 # with golangci-lint call it on a directory with the changed file. 1256 # 1257 # Default: false 1258 check-exported: true 1259 1260 varcheck: 1261 # Check usage of exported fields and variables. 1262 # Default: false 1263 exported-fields: true 1264 1265 varnamelen: 1266 # The longest distance, in source lines, that is being considered a "small scope". 1267 # Variables used in at most this many lines will be ignored. 1268 # Default: 5 1269 max-distance: 6 1270 # The minimum length of a variable's name that is considered "long". 1271 # Variable names that are at least this long will be ignored. 1272 # Default: 3 1273 min-name-length: 2 1274 # Check method receiver names. 1275 # Default: false 1276 check-receiver: true 1277 # Check named return values. 1278 # Default: false 1279 check-return: true 1280 # Ignore "ok" variables that hold the bool return value of a type assertion. 1281 # Default: false 1282 ignore-type-assert-ok: true 1283 # Ignore "ok" variables that hold the bool return value of a map index. 1284 # Default: false 1285 ignore-map-index-ok: true 1286 # Ignore "ok" variables that hold the bool return value of a channel receive. 1287 # Default: false 1288 ignore-chan-recv-ok: true 1289 # Optional list of variable names that should be ignored completely. 1290 # Default: [] 1291 ignore-names: 1292 - err 1293 # Optional list of variable declarations that should be ignored completely. 1294 # Entries must be in the form of "<variable name> <type>" or "<variable name> *<type>" 1295 # for variables, or "const <name>" for constants. 1296 # Default: [] 1297 ignore-decls: 1298 - c echo.Context 1299 - t testing.T 1300 - f *foo.Bar 1301 - e error 1302 - i int 1303 - const C 1304 1305 whitespace: 1306 # Enforces newlines (or comments) after every multi-line if statement. 1307 # Default: false 1308 multi-if: true 1309 # Enforces newlines (or comments) after every multi-line function signature. 1310 # Default: false 1311 multi-func: true 1312 1313 wrapcheck: 1314 # An array of strings that specify substrings of signatures to ignore. 1315 # If this set, it will override the default set of ignored signatures. 1316 # See https://github.com/tomarrell/wrapcheck#configuration for more information. 1317 ignoreSigs: 1318 - .Errorf( 1319 - errors.New( 1320 - errors.Unwrap( 1321 - .Wrap( 1322 - .Wrapf( 1323 - .WithMessage( 1324 - .WithMessagef( 1325 - .WithStack( 1326 ignoreSigRegexps: 1327 - \.New.*Error\( 1328 ignorePackageGlobs: 1329 - encoding/* 1330 - github.com/pkg/* 1331 1332 wsl: 1333 # See https://github.com/bombsimon/wsl/blob/master/doc/configuration.md for documentation of available settings. 1334 # These are the defaults for `golangci-lint`. 1335 1336 # Controls if you may cuddle assignments and anything without needing an empty line between them. 1337 # Default: false 1338 allow-assign-and-anything: false 1339 1340 # Controls if you may cuddle assignments and calls without needing an empty line between them. 1341 # Default: true 1342 allow-assign-and-call: true 1343 1344 # Controls if you're allowed to cuddle multiple declarations. 1345 # This is false by default to encourage you to group them in one var block. 1346 # One major benefit with this is that if the variables are assigned the assignments will be tabulated. 1347 # Default: false 1348 allow-cuddle-declarations: false 1349 1350 # Controls if you may cuddle assignments even if they span over multiple lines. 1351 # Default: true 1352 allow-multiline-assign: true 1353 1354 # This option allows whitespace after each comment group that begins a block. 1355 # Default: false 1356 allow-separated-leading-comment: false 1357 1358 # Controls if blocks can end with comments. 1359 # This is not encouraged sine it's usually code smell but might be useful do improve understanding or learning purposes. 1360 # To be allowed there must be no whitespace between the comment and the last statement or the comment and the closing brace. 1361 # Default: false 1362 allow-trailing-comment: false 1363 1364 # Can be set to force trailing newlines at the end of case blocks to improve readability. 1365 # If the number of lines (including comments) in a case block exceeds this number 1366 # a linter error will be yielded if the case does not end with a newline. 1367 # Default: 0 1368 force-case-trailing-whitespace: 0 1369 1370 # Enforces that an `if` statement checking an error variable is cuddled 1371 # with the line that assigned that error variable. 1372 # Default: false 1373 force-err-cuddling: false 1374 1375 # Enforces that an assignment which is actually a short declaration (using `:=`) 1376 # is only allowed to cuddle with other short declarations, and not plain assignments, blocks, etc. 1377 # This rule helps make declarations stand out by themselves, much the same as grouping var statement. 1378 # Default: false 1379 force-short-decl-cuddling: false 1380 1381 # Controls if the checks for slice append should be "strict" 1382 # in the sense that it will only allow these assignments to be cuddled with variables being appended. 1383 # Default: true 1384 strict-append: true 1385 1386 1387 1388 linters: 1389 # Disable all linters. 1390 disable-all: true 1391 # Enable specific linter 1392 # https://golangci-lint.run/usage/linters/#enabled-by-default-linters 1393 enable: 1394 - asciicheck 1395 - bidichk 1396 - bodyclose 1397 - contextcheck 1398 - cyclop 1399 - deadcode 1400 - depguard 1401 - dogsled 1402 - dupl 1403 - durationcheck 1404 - errcheck 1405 - errname 1406 - errorlint 1407 - exhaustive 1408 - exhaustivestruct 1409 - exportloopref 1410 - forbidigo 1411 - forcetypeassert 1412 - funlen 1413 - gci 1414 - gochecknoglobals 1415 - gocognit 1416 - goconst 1417 - gocritic 1418 - gocyclo 1419 - godot 1420 - godox 1421 - goerr113 1422 - gofmt 1423 - gofumpt 1424 - goheader 1425 - goimports 1426 - gomnd 1427 - gomoddirectives 1428 - gomodguard 1429 - goprintffuncname 1430 - gosec 1431 - gosimple 1432 - govet 1433 - ifshort 1434 - importas 1435 - ineffassign 1436 - ireturn 1437 - lll 1438 - makezero 1439 - misspell 1440 - nakedret 1441 - nestif 1442 - nilerr 1443 - nilnil 1444 - nlreturn 1445 - noctx 1446 - nolintlint 1447 - paralleltest 1448 - prealloc 1449 - predeclared 1450 - promlinter 1451 - revive 1452 - rowserrcheck 1453 - sqlclosecheck 1454 - staticcheck 1455 - structcheck 1456 - stylecheck 1457 - tagliatelle 1458 - tenv 1459 - testpackage 1460 - thelper 1461 - tparallel 1462 - typecheck 1463 - unconvert 1464 - unparam 1465 - unused 1466 - varcheck 1467 - varnamelen 1468 - wastedassign 1469 - whitespace 1470 - wrapcheck 1471 - wsl 1472 1473 # Enable all available linters. 1474 # enable-all: true 1475 # Disable specific linter 1476 # https://golangci-lint.run/usage/linters/#disabled-by-default-linters--e--enable 1477 disable: 1478 1479 1480 # Run only fast linters from enabled linters set (first run won't be fast) 1481 # Default: false 1482 fast: true 1483 1484 1485 issues: 1486 # List of regexps of issue texts to exclude. 1487 # 1488 # But independently of this option we use default exclude patterns, 1489 # it can be disabled by `exclude-use-default: false`. 1490 # To list all excluded by default patterns execute `golangci-lint run --help` 1491 # 1492 # Default: [] 1493 exclude: 1494 - abcdef 1495 1496 # Excluding configuration per-path, per-linter, per-text and per-source 1497 exclude-rules: 1498 # Exclude some linters from running on tests files. 1499 - path: _test\.go 1500 linters: 1501 - gocyclo 1502 - errcheck 1503 - dupl 1504 - gosec 1505 1506 # Exclude known linters from partially hard-vendored code, 1507 # which is impossible to exclude via `nolint` comments. 1508 - path: internal/hmac/ 1509 text: "weak cryptographic primitive" 1510 linters: 1511 - gosec 1512 1513 # Exclude some `staticcheck` messages. 1514 - linters: 1515 - staticcheck 1516 text: "SA9003:" 1517 1518 # Exclude `lll` issues for long lines with `go:generate`. 1519 - linters: 1520 - lll 1521 source: "^//go:generate " 1522 1523 # Independently of option `exclude` we use default exclude patterns, 1524 # it can be disabled by this option. 1525 # To list all excluded by default patterns execute `golangci-lint run --help`. 1526 # Default: true. 1527 exclude-use-default: false 1528 1529 # If set to true exclude and exclude-rules regular expressions become case-sensitive. 1530 # Default: false 1531 exclude-case-sensitive: false 1532 1533 # The list of ids of default excludes to include or disable. 1534 # Default: [] 1535 include: 1536 - EXC0002 # disable excluding of issues about comments from golint. 1537 1538 # Maximum issues count per one linter. 1539 # Set to 0 to disable. 1540 # Default: 50 1541 max-issues-per-linter: 0 1542 1543 # Maximum count of issues with the same text. 1544 # Set to 0 to disable. 1545 # Default: 3 1546 max-same-issues: 0 1547 1548 # Show only new issues: if there are unstaged changes or untracked files, 1549 # only those changes are analyzed, else only changes in HEAD~ are analyzed. 1550 # It's a super-useful option for integration of golangci-lint into existing large codebase. 1551 # It's not practical to fix all existing issues at the moment of integration: 1552 # much better don't allow issues in new code. 1553 # 1554 # Default: false. 1555 new: true 1556 1557 # Show only new issues created after git revision `REV`. 1558 new-from-rev: HEAD 1559 1560 # Show only new issues created in git patch with set file path. 1561 # new-from-patch: path/to/patch/file 1562 1563 # Fix found issues (if it's supported by the linter). 1564 fix: true 1565 1566 1567 severity: 1568 # Set the default severity for issues. 1569 # 1570 # If severity rules are defined and the issues do not match or no severity is provided to the rule 1571 # this will be the default severity applied. 1572 # Severities should match the supported severity names of the selected out format. 1573 # - Code climate: https://docs.codeclimate.com/docs/issues#issue-severity 1574 # - Checkstyle: https://checkstyle.sourceforge.io/property_types.html#severity 1575 # - GitHub: https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message 1576 # 1577 # Default value is an empty string. 1578 default-severity: error 1579 1580 # If set to true `severity-rules` regular expressions become case-sensitive. 1581 # Default: false 1582 case-sensitive: true 1583 1584 # When a list of severity rules are provided, severity information will be added to lint issues. 1585 # Severity rules have the same filtering capability as exclude rules 1586 # except you are allowed to specify one matcher per severity rule. 1587 # Only affects out formats that support setting severity information. 1588 # 1589 # Default: [] 1590 rules: 1591 - linters: 1592 - dupl 1593 severity: info