github.com/nozzle/golangci-lint@v1.49.0-nz3/.golangci.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 # The default concurrency value is the number of available CPU. 10 concurrency: 4 11 12 # Timeout for analysis, e.g. 30s, 5m. 13 # Default: 1m 14 timeout: 5m 15 16 # Exit code when at least one issue was found. 17 # Default: 1 18 issues-exit-code: 2 19 20 # Include test files or not. 21 # Default: true 22 tests: false 23 24 # List of build tags, all linters use it. 25 # Default: []. 26 build-tags: 27 - mytag 28 29 # Which dirs to skip: issues from them won't be reported. 30 # Can use regexp here: `generated.*`, regexp is applied on full path. 31 # Default value is empty list, 32 # but default dirs are skipped independently of this option's value (see skip-dirs-use-default). 33 # "/" will be replaced by current OS file path separator to properly work on Windows. 34 skip-dirs: 35 - src/external_libs 36 - autogenerated_by_my_lib 37 38 # Enables skipping of directories: 39 # - vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ 40 # Default: true 41 skip-dirs-use-default: false 42 43 # Which files to skip: they will be analyzed, but issues from them won't be reported. 44 # Default value is empty list, 45 # but there is no need to include all autogenerated files, 46 # we confidently recognize autogenerated files. 47 # If it's not please let us know. 48 # "/" will be replaced by current OS file path separator to properly work on Windows. 49 skip-files: 50 - ".*\\.my\\.go$" 51 - lib/bad.go 52 53 # If set we pass it to "go list -mod={option}". From "go help modules": 54 # If invoked with -mod=readonly, the go command is disallowed from the implicit 55 # automatic updating of go.mod described above. Instead, it fails when any changes 56 # to go.mod are needed. This setting is most useful to check that go.mod does 57 # not need updates, such as in a continuous integration and testing system. 58 # If invoked with -mod=vendor, the go command assumes that the vendor 59 # directory holds the correct copies of dependencies and ignores 60 # the dependency descriptions in go.mod. 61 # 62 # Allowed values: readonly|vendor|mod 63 # By default, it isn't set. 64 modules-download-mode: readonly 65 66 # Allow multiple parallel golangci-lint instances running. 67 # If false (default) - golangci-lint acquires file lock on start. 68 allow-parallel-runners: false 69 70 # Define the Go version limit. 71 # Mainly related to generics support since go1.18. 72 # Default: use Go version from the go.mod file, fallback on the env var `GOVERSION`, fallback on 1.18 73 go: '1.19' 74 75 76 # output configuration options 77 output: 78 # Format: colored-line-number|line-number|json|tab|checkstyle|code-climate|junit-xml|github-actions 79 # 80 # Multiple can be specified by separating them by comma, output can be provided 81 # for each of them by separating format name and path by colon symbol. 82 # Output path can be either `stdout`, `stderr` or path to the file to write to. 83 # Example: "checkstyle:report.json,colored-line-number" 84 # 85 # Default: colored-line-number 86 format: json 87 88 # Print lines of code with issue. 89 # Default: true 90 print-issued-lines: false 91 92 # Print linter name in the end of issue text. 93 # Default: true 94 print-linter-name: false 95 96 # Make issues output unique by line. 97 # Default: true 98 uniq-by-line: false 99 100 # Add a prefix to the output file references. 101 # Default is no prefix. 102 path-prefix: "" 103 104 # Sort results by: filepath, line and column. 105 sort-results: false 106 107 108 # All available settings of specific linters. 109 linters-settings: 110 asasalint: 111 # To specify a set of function names to exclude. 112 # The values are merged with the builtin exclusions. 113 # The builtin exclusions can be disabled by setting `use-builtin-exclusions` to `false`. 114 # Default: ["^(fmt|log|logger|t|)\.(Print|Fprint|Sprint|Fatal|Panic|Error|Warn|Warning|Info|Debug|Log)(|f|ln)$"] 115 exclude: 116 - Append 117 - \.Wrapf 118 # To enable/disable the asasalint builtin exclusions of function names. 119 # See the default value of `exclude` to get the builtin exclusions. 120 # Default: true 121 use-builtin-exclusions: false 122 # Ignore *_test.go files. 123 # Default: false 124 ignore-test: true 125 126 bidichk: 127 # The following configurations check for all mentioned invisible unicode runes. 128 # All runes are enabled by default. 129 left-to-right-embedding: false 130 right-to-left-embedding: false 131 pop-directional-formatting: false 132 left-to-right-override: false 133 right-to-left-override: false 134 left-to-right-isolate: false 135 right-to-left-isolate: false 136 first-strong-isolate: false 137 pop-directional-isolate: false 138 139 cyclop: 140 # The maximal code complexity to report. 141 # Default: 10 142 max-complexity: 10 143 # The maximal average package complexity. 144 # If it's higher than 0.0 (float) the check is enabled 145 # Default: 0.0 146 package-average: 0.5 147 # Should ignore tests. 148 # Default: false 149 skip-tests: true 150 151 decorder: 152 # Required order of `type`, `const`, `var` and `func` declarations inside a file. 153 # Default: types before constants before variables before functions. 154 dec-order: 155 - type 156 - const 157 - var 158 - func 159 160 # If true, order of declarations is not checked at all. 161 # Default: true (disabled) 162 disable-dec-order-check: false 163 164 # If true, `init` func can be anywhere in file (does not have to be declared before all other functions). 165 # Default: true (disabled) 166 disable-init-func-first-check: false 167 168 # If true, multiple global `type`, `const` and `var` declarations are allowed. 169 # Default: true (disabled) 170 disable-dec-num-check: false 171 172 depguard: 173 # Kind of list is passed in. 174 # Allowed values: allowlist|denylist 175 # Default: denylist 176 list-type: allowlist 177 178 # Check the list against standard lib. 179 # Default: false 180 include-go-root: true 181 182 # A list of packages for the list type specified. 183 # Can accept both string prefixes and string glob patterns. 184 # Default: [] 185 packages: 186 - github.com/sirupsen/logrus 187 - allow/**/pkg 188 189 # A list of packages for the list type specified. 190 # Specify an error message to output when a denied package is used. 191 # Default: [] 192 packages-with-error-message: 193 - github.com/sirupsen/logrus: 'logging is allowed only by logutils.Log' 194 195 # Specify rules by which the linter ignores certain files for consideration. 196 # Can accept both string prefixes and string glob patterns. 197 # The ! character in front of the rule is a special character 198 # which signals that the linter should negate the rule. 199 # This allows for more precise control, but it is only available for glob patterns. 200 # Default: [] 201 ignore-file-rules: 202 - "ignore/**/*.go" 203 - "!**/*_test.go" 204 205 # Create additional guards that follow the same configuration pattern. 206 # Results from all guards are aggregated together. 207 additional-guards: 208 - list-type: denylist 209 include-go-root: false 210 packages: 211 - github.com/stretchr/testify 212 # Specify rules by which the linter ignores certain files for consideration. 213 ignore-file-rules: 214 - "**/*_test.go" 215 - "**/mock/**/*.go" 216 217 dogsled: 218 # Checks assignments with too many blank identifiers. 219 # Default: 2 220 max-blank-identifiers: 3 221 222 dupl: 223 # Tokens count to trigger issue. 224 # Default: 150 225 threshold: 100 226 227 dupword: 228 # Keywords for detecting duplicate words. 229 # If this list is not empty, only the words defined in this list will be detected. 230 # Default: [] 231 keywords: 232 - "the" 233 - "and" 234 - "a" 235 236 errcheck: 237 # Report about not checking of errors in type assertions: `a := b.(MyStruct)`. 238 # Such cases aren't reported by default. 239 # Default: false 240 check-type-assertions: true 241 242 # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`. 243 # Such cases aren't reported by default. 244 # Default: false 245 check-blank: true 246 247 # DEPRECATED comma-separated list of pairs of the form pkg:regex 248 # 249 # the regex is used to ignore names within pkg. (default "fmt:.*"). 250 # see https://github.com/kisielk/errcheck#the-deprecated-method for details 251 ignore: fmt:.*,io/ioutil:^Read.* 252 253 # To disable the errcheck built-in exclude list. 254 # See `-excludeonly` option in https://github.com/kisielk/errcheck#excluding-functions for details. 255 # Default: false 256 disable-default-exclusions: true 257 258 # DEPRECATED use exclude-functions instead. 259 # 260 # Path to a file containing a list of functions to exclude from checking. 261 # See https://github.com/kisielk/errcheck#excluding-functions for details. 262 exclude: /path/to/file.txt 263 264 # List of functions to exclude from checking, where each entry is a single function to exclude. 265 # See https://github.com/kisielk/errcheck#excluding-functions for details. 266 exclude-functions: 267 - io/ioutil.ReadFile 268 - io.Copy(*bytes.Buffer) 269 - io.Copy(os.Stdout) 270 271 errchkjson: 272 # With check-error-free-encoding set to true, errchkjson does warn about errors 273 # from json encoding functions that are safe to be ignored, 274 # because they are not possible to happen. 275 # 276 # if check-error-free-encoding is set to true and errcheck linter is enabled, 277 # it is recommended to add the following exceptions to prevent from false positives: 278 # 279 # linters-settings: 280 # errcheck: 281 # exclude-functions: 282 # - encoding/json.Marshal 283 # - encoding/json.MarshalIndent 284 # 285 # Default: false 286 check-error-free-encoding: true 287 288 # Issue on struct encoding that doesn't have exported fields. 289 # Default: false 290 report-no-exported: false 291 292 errorlint: 293 # Check whether fmt.Errorf uses the %w verb for formatting errors. 294 # See the https://github.com/polyfloyd/go-errorlint for caveats. 295 # Default: true 296 errorf: false 297 # Check for plain type assertions and type switches. 298 # Default: true 299 asserts: false 300 # Check for plain error comparisons. 301 # Default: true 302 comparison: false 303 304 exhaustive: 305 # Program elements to check for exhaustiveness. 306 # Default: [ switch ] 307 check: 308 - switch 309 - map 310 # Check switch statements in generated files also. 311 # Default: false 312 check-generated: true 313 # Presence of "default" case in switch statements satisfies exhaustiveness, 314 # even if all enum members are not listed. 315 # Default: false 316 default-signifies-exhaustive: true 317 # Enum members matching the supplied regex do not have to be listed in 318 # switch statements to satisfy exhaustiveness. 319 # Default: "" 320 ignore-enum-members: "Example.+" 321 # Consider enums only in package scopes, not in inner scopes. 322 # Default: false 323 package-scope-only: true 324 # Only run exhaustive check on switches with "//exhaustive:enforce" comment. 325 # Default: false 326 explicit-exhaustive-switch: true 327 # Only run exhaustive check on map literals with "//exhaustive:enforce" comment. 328 # Default: false 329 explicit-exhaustive-map: true 330 331 exhaustivestruct: 332 # Struct Patterns is list of expressions to match struct packages and names. 333 # The struct packages have the form `example.com/package.ExampleStruct`. 334 # The matching patterns can use matching syntax from https://pkg.go.dev/path#Match. 335 # If this list is empty, all structs are tested. 336 # Default: [] 337 struct-patterns: 338 - '*.Test' 339 - 'example.com/package.ExampleStruct' 340 341 exhaustruct: 342 # List of regular expressions to match struct packages and names. 343 # If this list is empty, all structs are tested. 344 # Default: [] 345 include: 346 - '.*\.Test' 347 - 'example\.com/package\.ExampleStruct[\d]{1,2}' 348 # List of regular expressions to exclude struct packages and names from check. 349 # Default: [] 350 exclude: 351 - 'cobra\.Command$' 352 353 forbidigo: 354 # Forbid the following identifiers (list of regexp). 355 # Default: ["^(fmt\\.Print(|f|ln)|print|println)$"] 356 forbid: 357 - ^print.*$ 358 - 'fmt\.Print.*' 359 # Optionally put comments at the end of the regex, surrounded by `(# )?` 360 # Escape any special characters. 361 - 'fmt\.Print.*(# Do not commit print statements\.)?' 362 # Exclude godoc examples from forbidigo checks. 363 # Default: true 364 exclude_godoc_examples: false 365 366 funlen: 367 # Checks the number of lines in a function. 368 # If lower than 0, disable the check. 369 # Default: 60 370 lines: -1 371 # Checks the number of statements in a function. 372 # If lower than 0, disable the check. 373 # Default: 40 374 statements: -1 375 376 gci: 377 # DEPRECATED: use `sections` and `prefix(github.com/org/project)` instead. 378 local-prefixes: github.com/org/project 379 380 # Section configuration to compare against. 381 # Section names are case-insensitive and may contain parameters in (). 382 # The default order of sections is `standard > default > custom > blank > dot`, 383 # If `custom-order` is `true`, it follows the order of `sections` option. 384 # Default: ["standard", "default"] 385 sections: 386 - standard # Standard section: captures all standard packages. 387 - default # Default section: contains all imports that could not be matched to another section type. 388 - prefix(github.com/org/project) # Custom section: groups all imports with the specified Prefix. 389 - blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled. 390 - dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled. 391 392 # Skip generated files. 393 # Default: true 394 skip-generated: false 395 396 # Enable custom order of sections. 397 # If `true`, make the section order the same as the order of `sections`. 398 # Default: false 399 custom-order: true 400 401 gocognit: 402 # Minimal code complexity to report 403 # Default: 30 (but we recommend 10-20) 404 min-complexity: 10 405 406 goconst: 407 # Minimal length of string constant. 408 # Default: 3 409 min-len: 2 410 # Minimum occurrences of constant string count to trigger issue. 411 # Default: 3 412 min-occurrences: 2 413 # Ignore test files. 414 # Default: false 415 ignore-tests: true 416 # Look for existing constants matching the values. 417 # Default: true 418 match-constant: false 419 # Search also for duplicated numbers. 420 # Default: false 421 numbers: true 422 # Minimum value, only works with goconst.numbers 423 # Default: 3 424 min: 2 425 # Maximum value, only works with goconst.numbers 426 # Default: 3 427 max: 2 428 # Ignore when constant is not used as function argument. 429 # Default: true 430 ignore-calls: false 431 432 gocritic: 433 # Which checks should be enabled; can't be combined with 'disabled-checks'. 434 # See https://go-critic.github.io/overview#checks-overview. 435 # To check which checks are enabled run `GL_DEBUG=gocritic golangci-lint run`. 436 # By default, list of stable checks is used. 437 enabled-checks: 438 - nestingReduce 439 - unnamedResult 440 - ruleguard 441 - truncateCmp 442 443 # Which checks should be disabled; can't be combined with 'enabled-checks'. 444 # Default: [] 445 disabled-checks: 446 - regexpMust 447 448 # Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint run` to see all tags and checks. 449 # See https://github.com/go-critic/go-critic#usage -> section "Tags". 450 # Default: [] 451 enabled-tags: 452 - diagnostic 453 - style 454 - performance 455 - experimental 456 - opinionated 457 disabled-tags: 458 - diagnostic 459 - style 460 - performance 461 - experimental 462 - opinionated 463 464 # Settings passed to gocritic. 465 # The settings key is the name of a supported gocritic checker. 466 # The list of supported checkers can be find in https://go-critic.github.io/overview. 467 settings: 468 # Must be valid enabled check name. 469 captLocal: 470 # Whether to restrict checker to params only. 471 # Default: true 472 paramsOnly: false 473 elseif: 474 # Whether to skip balanced if-else pairs. 475 # Default: true 476 skipBalanced: false 477 hugeParam: 478 # Size in bytes that makes the warning trigger. 479 # Default: 80 480 sizeThreshold: 70 481 nestingReduce: 482 # Min number of statements inside a branch to trigger a warning. 483 # Default: 5 484 bodyWidth: 4 485 rangeExprCopy: 486 # Size in bytes that makes the warning trigger. 487 # Default: 512 488 sizeThreshold: 516 489 # Whether to check test functions 490 # Default: true 491 skipTestFuncs: false 492 rangeValCopy: 493 # Size in bytes that makes the warning trigger. 494 # Default: 128 495 sizeThreshold: 32 496 # Whether to check test functions. 497 # Default: true 498 skipTestFuncs: false 499 ruleguard: 500 # Enable debug to identify which 'Where' condition was rejected. 501 # The value of the parameter is the name of a function in a ruleguard file. 502 # 503 # When a rule is evaluated: 504 # If: 505 # The Match() clause is accepted; and 506 # One of the conditions in the Where() clause is rejected, 507 # Then: 508 # ruleguard prints the specific Where() condition that was rejected. 509 # 510 # The flag is passed to the ruleguard 'debug-group' argument. 511 # Default: "" 512 debug: 'emptyDecl' 513 # Deprecated, use 'failOn' param. 514 # If set to true, identical to failOn='all', otherwise failOn='' 515 failOnError: false 516 # Determines the behavior when an error occurs while parsing ruleguard files. 517 # If flag is not set, log error and skip rule files that contain an error. 518 # If flag is set, the value must be a comma-separated list of error conditions. 519 # - 'all': fail on all errors. 520 # - 'import': ruleguard rule imports a package that cannot be found. 521 # - 'dsl': gorule file does not comply with the ruleguard DSL. 522 # Default: "" 523 failOn: dsl 524 # Comma-separated list of file paths containing ruleguard rules. 525 # If a path is relative, it is relative to the directory where the golangci-lint command is executed. 526 # The special '${configDir}' variable is substituted with the absolute directory containing the golangci config file. 527 # Glob patterns such as 'rules-*.go' may be specified. 528 # Default: "" 529 rules: '${configDir}/ruleguard/rules-*.go,${configDir}/myrule1.go' 530 # Comma-separated list of enabled groups or skip empty to enable everything. 531 # Tags can be defined with # character prefix. 532 # Default: "<all>" 533 enable: "myGroupName,#myTagName" 534 # Comma-separated list of disabled groups or skip empty to enable everything. 535 # Tags can be defined with # character prefix. 536 # Default: "" 537 disable: "myGroupName,#myTagName" 538 tooManyResultsChecker: 539 # Maximum number of results. 540 # Default: 5 541 maxResults: 10 542 truncateCmp: 543 # Whether to skip int/uint/uintptr types. 544 # Default: true 545 skipArchDependent: false 546 underef: 547 # Whether to skip (*x).method() calls where x is a pointer receiver. 548 # Default: true 549 skipRecvDeref: false 550 unnamedResult: 551 # Whether to check exported functions. 552 # Default: false 553 checkExported: true 554 555 gocyclo: 556 # Minimal code complexity to report. 557 # Default: 30 (but we recommend 10-20) 558 min-complexity: 10 559 560 godot: 561 # Comments to be checked: `declarations`, `toplevel`, or `all`. 562 # Default: declarations 563 scope: toplevel 564 # List of regexps for excluding particular comment lines from check. 565 # Default: [] 566 exclude: 567 # Exclude todo and fixme comments. 568 - "^fixme:" 569 - "^todo:" 570 # Check that each sentence ends with a period. 571 # Default: true 572 period: false 573 # Check that each sentence starts with a capital letter. 574 # Default: false 575 capital: true 576 577 godox: 578 # Report any comments starting with keywords, this is useful for TODO or FIXME comments that 579 # might be left in the code accidentally and should be resolved before merging. 580 # Default: ["TODO", "BUG", "FIXME"] 581 keywords: 582 - NOTE 583 - OPTIMIZE # marks code that should be optimized before merging 584 - HACK # marks hack-around that should be removed before merging 585 586 gofmt: 587 # Simplify code: gofmt with `-s` option. 588 # Default: true 589 simplify: false 590 # Apply the rewrite rules to the source before reformatting. 591 # https://pkg.go.dev/cmd/gofmt 592 # Default: [] 593 rewrite-rules: 594 - pattern: 'interface{}' 595 replacement: 'any' 596 - pattern: 'a[b:len(a)]' 597 replacement: 'a[b:]' 598 599 gofumpt: 600 # Select the Go version to target. 601 # Default: "1.15" 602 # Deprecated: use the global `run.go` instead. 603 lang-version: "1.17" 604 605 # Module path which contains the source code being formatted. 606 # Default: "" 607 module-path: github.com/org/project 608 609 # Choose whether to use the extra rules. 610 # Default: false 611 extra-rules: true 612 613 goheader: 614 # Supports two types 'const` and `regexp`. 615 # Values can be used recursively. 616 # Default: {} 617 values: 618 const: 619 # Define here const type values in format k:v. 620 # For example: 621 COMPANY: MY COMPANY 622 regexp: 623 # Define here regexp type values. 624 # for example: 625 AUTHOR: .*@mycompany\.com 626 # The template use for checking. 627 # Default: "" 628 template: |- 629 # Put here copyright header template for source code files 630 # For example: 631 # Note: {{ YEAR }} is a builtin value that returns the year relative to the current machine time. 632 # 633 # {{ AUTHOR }} {{ COMPANY }} {{ YEAR }} 634 # SPDX-License-Identifier: Apache-2.0 635 636 # Licensed under the Apache License, Version 2.0 (the "License"); 637 # you may not use this file except in compliance with the License. 638 # You may obtain a copy of the License at: 639 640 # http://www.apache.org/licenses/LICENSE-2.0 641 642 # Unless required by applicable law or agreed to in writing, software 643 # distributed under the License is distributed on an "AS IS" BASIS, 644 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 645 # See the License for the specific language governing permissions and 646 # limitations under the License. 647 # As alternative of directive 'template', you may put the path to file with the template source. 648 # Useful if you need to load the template from a specific file. 649 # Default: "" 650 template-path: /path/to/my/template.tmpl 651 652 goimports: 653 # Put imports beginning with prefix after 3rd-party packages. 654 # It's a comma-separated list of prefixes. 655 # Default: "" 656 local-prefixes: github.com/org/project 657 658 golint: 659 # Minimal confidence for issues. 660 # Default: 0.8 661 min-confidence: 0.7 662 663 gomnd: 664 # List of enabled checks, see https://github.com/tommy-muehle/go-mnd/#checks for description. 665 # Default: ["argument", "case", "condition", "operation", "return", "assign"] 666 checks: 667 - argument 668 - case 669 - condition 670 - operation 671 - return 672 - assign 673 # List of numbers to exclude from analysis. 674 # The numbers should be written as string. 675 # Values always ignored: "1", "1.0", "0" and "0.0" 676 # Default: [] 677 ignored-numbers: 678 - '0666' 679 - '0755' 680 - '42' 681 # List of file patterns to exclude from analysis. 682 # Values always ignored: `.+_test.go` 683 # Default: [] 684 ignored-files: 685 - 'magic1_.*.go' 686 # List of function patterns to exclude from analysis. 687 # Values always ignored: `time.Date` 688 # Default: [] 689 ignored-functions: 690 - 'math.*' 691 - 'http.StatusText' 692 693 gomoddirectives: 694 # Allow local `replace` directives. 695 # Default: false 696 replace-local: false 697 # List of allowed `replace` directives. 698 # Default: [] 699 replace-allow-list: 700 - launchpad.net/gocheck 701 # Allow to not explain why the version has been retracted in the `retract` directives. 702 # Default: false 703 retract-allow-no-explanation: false 704 # Forbid the use of the `exclude` directives. 705 # Default: false 706 exclude-forbidden: false 707 708 gomodguard: 709 allowed: 710 # List of allowed modules. 711 # Default: [] 712 modules: 713 - gopkg.in/yaml.v2 714 # List of allowed module domains. 715 # Default: [] 716 domains: 717 - golang.org 718 blocked: 719 # List of blocked modules. 720 # Default: [] 721 modules: 722 # Blocked module. 723 - github.com/uudashr/go-module: 724 # Recommended modules that should be used instead. (Optional) 725 recommendations: 726 - golang.org/x/mod 727 # Reason why the recommended module should be used. (Optional) 728 reason: "`mod` is the official go.mod parser library." 729 # List of blocked module version constraints. 730 # Default: [] 731 versions: 732 # Blocked module with version constraint. 733 - github.com/mitchellh/go-homedir: 734 # Version constraint, see https://github.com/Masterminds/semver#basic-comparisons. 735 version: "< 1.1.0" 736 # Reason why the version constraint exists. (Optional) 737 reason: "testing if blocked version constraint works." 738 # Set to true to raise lint issues for packages that are loaded from a local path via replace directive. 739 # Default: false 740 local_replace_directives: false 741 742 gosimple: 743 # Select the Go version to target. 744 # Default: 1.13 745 # Deprecated: use the global `run.go` instead. 746 go: "1.15" 747 # Sxxxx checks in https://staticcheck.io/docs/configuration/options/#checks 748 # Default: ["*"] 749 checks: [ "all" ] 750 751 gosec: 752 # To select a subset of rules to run. 753 # Available rules: https://github.com/securego/gosec#available-rules 754 # Default: [] - means include all rules 755 includes: 756 - G101 # Look for hard coded credentials 757 - G102 # Bind to all interfaces 758 - G103 # Audit the use of unsafe block 759 - G104 # Audit errors not checked 760 - G106 # Audit the use of ssh.InsecureIgnoreHostKey 761 - G107 # Url provided to HTTP request as taint input 762 - G108 # Profiling endpoint automatically exposed on /debug/pprof 763 - G109 # Potential Integer overflow made by strconv.Atoi result conversion to int16/32 764 - G110 # Potential DoS vulnerability via decompression bomb 765 - G111 # Potential directory traversal 766 - G112 # Potential slowloris attack 767 - G113 # Usage of Rat.SetString in math/big with an overflow (CVE-2022-23772) 768 - G114 # Use of net/http serve function that has no support for setting timeouts 769 - G201 # SQL query construction using format string 770 - G202 # SQL query construction using string concatenation 771 - G203 # Use of unescaped data in HTML templates 772 - G204 # Audit use of command execution 773 - G301 # Poor file permissions used when creating a directory 774 - G302 # Poor file permissions used with chmod 775 - G303 # Creating tempfile using a predictable path 776 - G304 # File path provided as taint input 777 - G305 # File traversal when extracting zip/tar archive 778 - G306 # Poor file permissions used when writing to a new file 779 - G307 # Deferring a method which returns an error 780 - G401 # Detect the usage of DES, RC4, MD5 or SHA1 781 - G402 # Look for bad TLS connection settings 782 - G403 # Ensure minimum RSA key length of 2048 bits 783 - G404 # Insecure random number source (rand) 784 - G501 # Import blocklist: crypto/md5 785 - G502 # Import blocklist: crypto/des 786 - G503 # Import blocklist: crypto/rc4 787 - G504 # Import blocklist: net/http/cgi 788 - G505 # Import blocklist: crypto/sha1 789 - G601 # Implicit memory aliasing of items from a range statement 790 791 # To specify a set of rules to explicitly exclude. 792 # Available rules: https://github.com/securego/gosec#available-rules 793 # Default: [] 794 excludes: 795 - G101 # Look for hard coded credentials 796 - G102 # Bind to all interfaces 797 - G103 # Audit the use of unsafe block 798 - G104 # Audit errors not checked 799 - G106 # Audit the use of ssh.InsecureIgnoreHostKey 800 - G107 # Url provided to HTTP request as taint input 801 - G108 # Profiling endpoint automatically exposed on /debug/pprof 802 - G109 # Potential Integer overflow made by strconv.Atoi result conversion to int16/32 803 - G110 # Potential DoS vulnerability via decompression bomb 804 - G111 # Potential directory traversal 805 - G112 # Potential slowloris attack 806 - G113 # Usage of Rat.SetString in math/big with an overflow (CVE-2022-23772) 807 - G114 # Use of net/http serve function that has no support for setting timeouts 808 - G201 # SQL query construction using format string 809 - G202 # SQL query construction using string concatenation 810 - G203 # Use of unescaped data in HTML templates 811 - G204 # Audit use of command execution 812 - G301 # Poor file permissions used when creating a directory 813 - G302 # Poor file permissions used with chmod 814 - G303 # Creating tempfile using a predictable path 815 - G304 # File path provided as taint input 816 - G305 # File traversal when extracting zip/tar archive 817 - G306 # Poor file permissions used when writing to a new file 818 - G307 # Deferring a method which returns an error 819 - G401 # Detect the usage of DES, RC4, MD5 or SHA1 820 - G402 # Look for bad TLS connection settings 821 - G403 # Ensure minimum RSA key length of 2048 bits 822 - G404 # Insecure random number source (rand) 823 - G501 # Import blocklist: crypto/md5 824 - G502 # Import blocklist: crypto/des 825 - G503 # Import blocklist: crypto/rc4 826 - G504 # Import blocklist: net/http/cgi 827 - G505 # Import blocklist: crypto/sha1 828 - G601 # Implicit memory aliasing of items from a range statement 829 830 # Exclude generated files 831 # Default: false 832 exclude-generated: true 833 834 # Filter out the issues with a lower severity than the given value. 835 # Valid options are: low, medium, high. 836 # Default: low 837 severity: medium 838 839 # Filter out the issues with a lower confidence than the given value. 840 # Valid options are: low, medium, high. 841 # Default: low 842 confidence: medium 843 844 # Concurrency value. 845 # Default: the number of logical CPUs usable by the current process. 846 concurrency: 12 847 848 # To specify the configuration of rules. 849 config: 850 # Globals are applicable to all rules. 851 global: 852 # If true, ignore #nosec in comments (and an alternative as well). 853 # Default: false 854 nosec: true 855 # Add an alternative comment prefix to #nosec (both will work at the same time). 856 # Default: "" 857 "#nosec": "#my-custom-nosec" 858 # Define whether nosec issues are counted as finding or not. 859 # Default: false 860 show-ignored: true 861 # Audit mode enables addition checks that for normal code analysis might be too nosy. 862 # Default: false 863 audit: true 864 G101: 865 # Regexp pattern for variables and constants to find. 866 # Default: "(?i)passwd|pass|password|pwd|secret|token|pw|apiKey|bearer|cred" 867 pattern: "(?i)example" 868 # If true, complain about all cases (even with low entropy). 869 # Default: false 870 ignore_entropy: false 871 # Maximum allowed entropy of the string. 872 # Default: "80.0" 873 entropy_threshold: "80.0" 874 # Maximum allowed value of entropy/string length. 875 # Is taken into account if entropy >= entropy_threshold/2. 876 # Default: "3.0" 877 per_char_threshold: "3.0" 878 # Calculate entropy for first N chars of the string. 879 # Default: "16" 880 truncate: "32" 881 # Additional functions to ignore while checking unhandled errors. 882 # Following functions always ignored: 883 # bytes.Buffer: 884 # - Write 885 # - WriteByte 886 # - WriteRune 887 # - WriteString 888 # fmt: 889 # - Print 890 # - Printf 891 # - Println 892 # - Fprint 893 # - Fprintf 894 # - Fprintln 895 # strings.Builder: 896 # - Write 897 # - WriteByte 898 # - WriteRune 899 # - WriteString 900 # io.PipeWriter: 901 # - CloseWithError 902 # hash.Hash: 903 # - Write 904 # os: 905 # - Unsetenv 906 # Default: {} 907 G104: 908 fmt: 909 - Fscanf 910 G111: 911 # Regexp pattern to find potential directory traversal. 912 # Default: "http\\.Dir\\(\"\\/\"\\)|http\\.Dir\\('\\/'\\)" 913 pattern: "custom\\.Dir\\(\\)" 914 # Maximum allowed permissions mode for os.Mkdir and os.MkdirAll 915 # Default: "0750" 916 G301: "0750" 917 # Maximum allowed permissions mode for os.OpenFile and os.Chmod 918 # Default: "0600" 919 G302: "0600" 920 # Maximum allowed permissions mode for os.WriteFile and ioutil.WriteFile 921 # Default: "0600" 922 G306: "0600" 923 924 govet: 925 # Report about shadowed variables. 926 # Default: false 927 check-shadowing: true 928 929 # Settings per analyzer. 930 settings: 931 # Analyzer name, run `go tool vet help` to see all analyzers. 932 printf: 933 # Comma-separated list of print function names to check (in addition to default, see `go tool vet help printf`). 934 # Default: [] 935 funcs: 936 - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof 937 - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf 938 - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf 939 - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf 940 shadow: 941 # Whether to be strict about shadowing; can be noisy. 942 # Default: false 943 strict: true 944 unusedresult: 945 # Comma-separated list of functions whose results must be used 946 # (in addition to defaults context.WithCancel,context.WithDeadline,context.WithTimeout,context.WithValue, 947 # errors.New,fmt.Errorf,fmt.Sprint,fmt.Sprintf,sort.Reverse) 948 # Default [] 949 funcs: 950 - pkg.MyFunc 951 # Comma-separated list of names of methods of type func() string whose results must be used 952 # (in addition to default Error,String) 953 # Default [] 954 stringmethods: 955 - MyMethod 956 957 # Disable all analyzers. 958 # Default: false 959 disable-all: true 960 # Enable analyzers by name (in addition to default). 961 # Run `go tool vet help` to see all analyzers. 962 # Default: [] 963 enable: 964 - asmdecl 965 - assign 966 - atomic 967 - atomicalign 968 - bools 969 - buildtag 970 - cgocall 971 - composites 972 - copylocks 973 - deepequalerrors 974 - errorsas 975 - fieldalignment 976 - findcall 977 - framepointer 978 - httpresponse 979 - ifaceassert 980 - loopclosure 981 - lostcancel 982 - nilfunc 983 - nilness 984 - printf 985 - reflectvaluecompare 986 - shadow 987 - shift 988 - sigchanyzer 989 - sortslice 990 - stdmethods 991 - stringintconv 992 - structtag 993 - testinggoroutine 994 - tests 995 - unmarshal 996 - unreachable 997 - unsafeptr 998 - unusedresult 999 - unusedwrite 1000 1001 # Enable all analyzers. 1002 # Default: false 1003 enable-all: true 1004 # Disable analyzers by name. 1005 # Run `go tool vet help` to see all analyzers. 1006 # Default: [] 1007 disable: 1008 - asmdecl 1009 - assign 1010 - atomic 1011 - atomicalign 1012 - bools 1013 - buildtag 1014 - cgocall 1015 - composites 1016 - copylocks 1017 - deepequalerrors 1018 - errorsas 1019 - fieldalignment 1020 - findcall 1021 - framepointer 1022 - httpresponse 1023 - ifaceassert 1024 - loopclosure 1025 - lostcancel 1026 - nilfunc 1027 - nilness 1028 - printf 1029 - reflectvaluecompare 1030 - shadow 1031 - shift 1032 - sigchanyzer 1033 - sortslice 1034 - stdmethods 1035 - stringintconv 1036 - structtag 1037 - testinggoroutine 1038 - tests 1039 - unmarshal 1040 - unreachable 1041 - unsafeptr 1042 - unusedresult 1043 - unusedwrite 1044 1045 grouper: 1046 # Require the use of a single global 'const' declaration only. 1047 # Default: false 1048 const-require-single-const: true 1049 # Require the use of grouped global 'const' declarations. 1050 # Default: false 1051 const-require-grouping: true 1052 1053 # Require the use of a single 'import' declaration only. 1054 # Default: false 1055 import-require-single-import: true 1056 # Require the use of grouped 'import' declarations. 1057 # Default: false 1058 import-require-grouping: true 1059 1060 # Require the use of a single global 'type' declaration only. 1061 # Default: false 1062 type-require-single-type: true 1063 # Require the use of grouped global 'type' declarations. 1064 # Default: false 1065 type-require-grouping: true 1066 1067 # Require the use of a single global 'var' declaration only. 1068 # Default: false 1069 var-require-single-var: true 1070 # Require the use of grouped global 'var' declarations. 1071 # Default: false 1072 var-require-grouping: true 1073 1074 ifshort: 1075 # Maximum length of variable declaration measured in number of lines, after which linter won't suggest using short syntax. 1076 # Has higher priority than max-decl-chars. 1077 # Default: 1 1078 max-decl-lines: 2 1079 # Maximum length of variable declaration measured in number of characters, after which linter won't suggest using short syntax. 1080 # Default: 30 1081 max-decl-chars: 40 1082 1083 importas: 1084 # Do not allow unaliased imports of aliased packages. 1085 # Default: false 1086 no-unaliased: true 1087 # Do not allow non-required aliases. 1088 # Default: false 1089 no-extra-aliases: true 1090 # List of aliases 1091 # Default: [] 1092 alias: 1093 # Using `servingv1` alias for `knative.dev/serving/pkg/apis/serving/v1` package. 1094 - pkg: knative.dev/serving/pkg/apis/serving/v1 1095 alias: servingv1 1096 # Using `autoscalingv1alpha1` alias for `knative.dev/serving/pkg/apis/autoscaling/v1alpha1` package. 1097 - pkg: knative.dev/serving/pkg/apis/autoscaling/v1alpha1 1098 alias: autoscalingv1alpha1 1099 # You can specify the package path by regular expression, 1100 # and alias by regular expression expansion syntax like below. 1101 # see https://github.com/julz/importas#use-regular-expression for details 1102 - pkg: knative.dev/serving/pkg/apis/(\w+)/(v[\w\d]+) 1103 alias: $1$2 1104 1105 interfacebloat: 1106 # The maximum number of methods allowed for an interface. 1107 # Default: 10 1108 max: 5 1109 1110 ireturn: 1111 # ireturn allows using `allow` and `reject` settings at the same time. 1112 # Both settings are lists of the keywords and regular expressions matched to interface or package names. 1113 # keywords: 1114 # - `empty` for `interface{}` 1115 # - `error` for errors 1116 # - `stdlib` for standard library 1117 # - `anon` for anonymous interfaces 1118 1119 # By default, it allows using errors, empty interfaces, anonymous interfaces, 1120 # and interfaces provided by the standard library. 1121 allow: 1122 - anon 1123 - error 1124 - empty 1125 - stdlib 1126 # You can specify idiomatic endings for interface 1127 - (or|er)$ 1128 1129 # reject-list of interfaces 1130 reject: 1131 - github.com\/user\/package\/v4\.Type 1132 1133 lll: 1134 # Max line length, lines longer will be reported. 1135 # '\t' is counted as 1 character by default, and can be changed with the tab-width option. 1136 # Default: 120. 1137 line-length: 120 1138 # Tab width in spaces. 1139 # Default: 1 1140 tab-width: 1 1141 1142 loggercheck: 1143 # Allow check for the github.com/go-kit/log library. 1144 # Default: true 1145 kitlog: false 1146 # Allow check for the k8s.io/klog/v2 library. 1147 # Default: true 1148 klog: false 1149 # Allow check for the github.com/go-logr/logr library. 1150 # Default: true 1151 logr: false 1152 # Allow check for the "sugar logger" from go.uber.org/zap library. 1153 # Default: true 1154 zap: false 1155 # Require all logging keys to be inlined constant strings. 1156 # Default: false 1157 require-string-key: true 1158 # Require printf-like format specifier (%s, %d for example) not present. 1159 # Default: false 1160 no-printf-like: true 1161 # List of custom rules to check against, where each rule is a single logger pattern, useful for wrapped loggers. 1162 # For example: https://github.com/timonwong/loggercheck/blob/7395ab86595781e33f7afba27ad7b55e6956ebcd/testdata/custom-rules.txt 1163 # Default: empty 1164 rules: 1165 - k8s.io/klog/v2.InfoS # package level exported functions 1166 - (github.com/go-logr/logr.Logger).Error # "Methods" 1167 - (*go.uber.org/zap.SugaredLogger).With # Also "Methods", but with a pointer receiver 1168 maintidx: 1169 # Show functions with maintainability index lower than N. 1170 # A high index indicates better maintainability (it's kind of the opposite of complexity). 1171 # Default: 20 1172 under: 100 1173 1174 makezero: 1175 # Allow only slices initialized with a length of zero. 1176 # Default: false 1177 always: true 1178 1179 maligned: 1180 # Print struct with more effective memory layout or not. 1181 # Default: false 1182 suggest-new: true 1183 1184 misspell: 1185 # Correct spellings using locale preferences for US or UK. 1186 # Setting locale to US will correct the British spelling of 'colour' to 'color'. 1187 # Default is to use a neutral variety of English. 1188 locale: US 1189 # Default: [] 1190 ignore-words: 1191 - someword 1192 1193 nakedret: 1194 # Make an issue if func has more lines of code than this setting, and it has naked returns. 1195 # Default: 30 1196 max-func-lines: 31 1197 1198 nestif: 1199 # Minimal complexity of if statements to report. 1200 # Default: 5 1201 min-complexity: 4 1202 1203 nilnil: 1204 # Checks that there is no simultaneous return of `nil` error and an invalid value. 1205 # Default: ["ptr", "func", "iface", "map", "chan"] 1206 checked-types: 1207 - ptr 1208 - func 1209 - iface 1210 - map 1211 - chan 1212 1213 nlreturn: 1214 # Size of the block (including return statement that is still "OK") 1215 # so no return split required. 1216 # Default: 1 1217 block-size: 2 1218 1219 nolintlint: 1220 # Disable to ensure that all nolint directives actually have an effect. 1221 # Default: false 1222 allow-unused: true 1223 # Exclude following linters from requiring an explanation. 1224 # Default: [] 1225 allow-no-explanation: [ ] 1226 # Enable to require an explanation of nonzero length after each nolint directive. 1227 # Default: false 1228 require-explanation: true 1229 # Enable to require nolint directives to mention the specific linter being suppressed. 1230 # Default: false 1231 require-specific: true 1232 1233 nonamedreturns: 1234 # Report named error if it is assigned inside defer. 1235 # Default: false 1236 report-error-in-defer: true 1237 1238 paralleltest: 1239 # Ignore missing calls to `t.Parallel()` and only report incorrect uses of it. 1240 # Default: false 1241 ignore-missing: true 1242 1243 prealloc: 1244 # IMPORTANT: we don't recommend using this linter before doing performance profiling. 1245 # For most programs usage of prealloc will be a premature optimization. 1246 1247 # Report pre-allocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them. 1248 # Default: true 1249 simple: false 1250 # Report pre-allocation suggestions on range loops. 1251 # Default: true 1252 range-loops: false 1253 # Report pre-allocation suggestions on for loops. 1254 # Default: false 1255 for-loops: true 1256 1257 predeclared: 1258 # Comma-separated list of predeclared identifiers to not report on. 1259 # Default: "" 1260 ignore: "new,int" 1261 # Include method names and field names (i.e., qualified names) in checks. 1262 # Default: false 1263 q: true 1264 1265 promlinter: 1266 # Promlinter cannot infer all metrics name in static analysis. 1267 # Enable strict mode will also include the errors caused by failing to parse the args. 1268 # Default: false 1269 strict: true 1270 # Please refer to https://github.com/yeya24/promlinter#usage for detailed usage. 1271 # Default: [] 1272 disabled-linters: 1273 - Help 1274 - MetricUnits 1275 - Counter 1276 - HistogramSummaryReserved 1277 - MetricTypeInName 1278 - ReservedChars 1279 - CamelCase 1280 - UnitAbbreviations 1281 1282 reassign: 1283 # Patterns for global variable names that are checked for reassignment. 1284 # See https://github.com/curioswitch/go-reassign#usage 1285 # Default: ["EOF", "Err.*"] 1286 patterns: 1287 - ".*" 1288 1289 revive: 1290 # Maximum number of open files at the same time. 1291 # See https://github.com/mgechev/revive#command-line-flags 1292 # Defaults to unlimited. 1293 max-open-files: 2048 1294 1295 # When set to false, ignores files with "GENERATED" header, similar to golint. 1296 # See https://github.com/mgechev/revive#available-rules for details. 1297 # Default: false 1298 ignore-generated-header: true 1299 1300 # Sets the default severity. 1301 # See https://github.com/mgechev/revive#configuration 1302 # Default: warning 1303 severity: error 1304 1305 # Enable all available rules. 1306 # Default: false 1307 enable-all-rules: true 1308 1309 # Sets the default failure confidence. 1310 # This means that linting errors with less than 0.8 confidence will be ignored. 1311 # Default: 0.8 1312 confidence: 0.1 1313 1314 rules: 1315 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#add-constant 1316 - name: add-constant 1317 severity: warning 1318 disabled: false 1319 arguments: 1320 - maxLitCount: "3" 1321 allowStrs: '""' 1322 allowInts: "0,1,2" 1323 allowFloats: "0.0,0.,1.0,1.,2.0,2." 1324 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#argument-limit 1325 - name: argument-limit 1326 severity: warning 1327 disabled: false 1328 arguments: [ 4 ] 1329 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#atomic 1330 - name: atomic 1331 severity: warning 1332 disabled: false 1333 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#banned-characters 1334 - name: banned-characters 1335 severity: warning 1336 disabled: false 1337 arguments: [ "Ω","Σ","σ", "7" ] 1338 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#bare-return 1339 - name: bare-return 1340 severity: warning 1341 disabled: false 1342 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#blank-imports 1343 - name: blank-imports 1344 severity: warning 1345 disabled: false 1346 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#bool-literal-in-expr 1347 - name: bool-literal-in-expr 1348 severity: warning 1349 disabled: false 1350 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#call-to-gc 1351 - name: call-to-gc 1352 severity: warning 1353 disabled: false 1354 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#cognitive-complexity 1355 - name: cognitive-complexity 1356 severity: warning 1357 disabled: false 1358 arguments: [ 7 ] 1359 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#confusing-naming 1360 - name: confusing-naming 1361 severity: warning 1362 disabled: false 1363 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#confusing-results 1364 - name: confusing-results 1365 severity: warning 1366 disabled: false 1367 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#constant-logical-expr 1368 - name: constant-logical-expr 1369 severity: warning 1370 disabled: false 1371 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#context-as-argument 1372 - name: context-as-argument 1373 severity: warning 1374 disabled: false 1375 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#context-keys-type 1376 - name: context-keys-type 1377 severity: warning 1378 disabled: false 1379 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#cyclomatic 1380 - name: cyclomatic 1381 severity: warning 1382 disabled: false 1383 arguments: [ 3 ] 1384 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#datarace 1385 - name: datarace 1386 severity: warning 1387 disabled: false 1388 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#deep-exit 1389 - name: deep-exit 1390 severity: warning 1391 disabled: false 1392 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#defer 1393 - name: defer 1394 severity: warning 1395 disabled: false 1396 arguments: 1397 - [ "call-chain", "loop" ] 1398 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#dot-imports 1399 - name: dot-imports 1400 severity: warning 1401 disabled: false 1402 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#duplicated-imports 1403 - name: duplicated-imports 1404 severity: warning 1405 disabled: false 1406 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#early-return 1407 - name: early-return 1408 severity: warning 1409 disabled: false 1410 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#empty-block 1411 - name: empty-block 1412 severity: warning 1413 disabled: false 1414 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#empty-lines 1415 - name: empty-lines 1416 severity: warning 1417 disabled: false 1418 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#error-naming 1419 - name: error-naming 1420 severity: warning 1421 disabled: false 1422 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#error-return 1423 - name: error-return 1424 severity: warning 1425 disabled: false 1426 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#error-strings 1427 - name: error-strings 1428 severity: warning 1429 disabled: false 1430 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#errorf 1431 - name: errorf 1432 severity: warning 1433 disabled: false 1434 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#exported 1435 - name: exported 1436 severity: warning 1437 disabled: false 1438 arguments: 1439 - "checkPrivateReceivers" 1440 - "sayRepetitiveInsteadOfStutters" 1441 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#file-header 1442 - name: file-header 1443 severity: warning 1444 disabled: false 1445 arguments: 1446 - This is the text that must appear at the top of source files. 1447 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#flag-parameter 1448 - name: flag-parameter 1449 severity: warning 1450 disabled: false 1451 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#function-result-limit 1452 - name: function-result-limit 1453 severity: warning 1454 disabled: false 1455 arguments: [ 2 ] 1456 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#function-length 1457 - name: function-length 1458 severity: warning 1459 disabled: false 1460 arguments: [ 10, 0 ] 1461 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#get-return 1462 - name: get-return 1463 severity: warning 1464 disabled: false 1465 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#identical-branches 1466 - name: identical-branches 1467 severity: warning 1468 disabled: false 1469 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#if-return 1470 - name: if-return 1471 severity: warning 1472 disabled: false 1473 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#increment-decrement 1474 - name: increment-decrement 1475 severity: warning 1476 disabled: false 1477 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#indent-error-flow 1478 - name: indent-error-flow 1479 severity: warning 1480 disabled: false 1481 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#imports-blacklist 1482 - name: imports-blacklist 1483 severity: warning 1484 disabled: false 1485 arguments: 1486 - "crypto/md5" 1487 - "crypto/sha1" 1488 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#import-shadowing 1489 - name: import-shadowing 1490 severity: warning 1491 disabled: false 1492 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#line-length-limit 1493 - name: line-length-limit 1494 severity: warning 1495 disabled: false 1496 arguments: [ 80 ] 1497 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#max-public-structs 1498 - name: max-public-structs 1499 severity: warning 1500 disabled: false 1501 arguments: [ 3 ] 1502 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#modifies-parameter 1503 - name: modifies-parameter 1504 severity: warning 1505 disabled: false 1506 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#modifies-value-receiver 1507 - name: modifies-value-receiver 1508 severity: warning 1509 disabled: false 1510 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#nested-structs 1511 - name: nested-structs 1512 severity: warning 1513 disabled: false 1514 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#optimize-operands-order 1515 - name: optimize-operands-order 1516 severity: warning 1517 disabled: false 1518 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#package-comments 1519 - name: package-comments 1520 severity: warning 1521 disabled: false 1522 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#range 1523 - name: range 1524 severity: warning 1525 disabled: false 1526 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#range-val-in-closure 1527 - name: range-val-in-closure 1528 severity: warning 1529 disabled: false 1530 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#range-val-address 1531 - name: range-val-address 1532 severity: warning 1533 disabled: false 1534 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#receiver-naming 1535 - name: receiver-naming 1536 severity: warning 1537 disabled: false 1538 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#redefines-builtin-id 1539 - name: redefines-builtin-id 1540 severity: warning 1541 disabled: false 1542 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#string-of-int 1543 - name: string-of-int 1544 severity: warning 1545 disabled: false 1546 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#string-format 1547 - name: string-format 1548 severity: warning 1549 disabled: false 1550 arguments: 1551 - - 'core.WriteError[1].Message' 1552 - '/^([^A-Z]|$)/' 1553 - must not start with a capital letter 1554 - - 'fmt.Errorf[0]' 1555 - '/(^|[^\.!?])$/' 1556 - must not end in punctuation 1557 - - panic 1558 - '/^[^\n]*$/' 1559 - must not contain line breaks 1560 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#struct-tag 1561 - name: struct-tag 1562 severity: warning 1563 disabled: false 1564 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#superfluous-else 1565 - name: superfluous-else 1566 severity: warning 1567 disabled: false 1568 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#time-equal 1569 - name: time-equal 1570 severity: warning 1571 disabled: false 1572 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#time-naming 1573 - name: time-naming 1574 severity: warning 1575 disabled: false 1576 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#var-naming 1577 - name: var-naming 1578 severity: warning 1579 disabled: false 1580 arguments: 1581 - [ "ID" ] # AllowList 1582 - [ "VM" ] # DenyList 1583 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#var-declaration 1584 - name: var-declaration 1585 severity: warning 1586 disabled: false 1587 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unconditional-recursion 1588 - name: unconditional-recursion 1589 severity: warning 1590 disabled: false 1591 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unexported-naming 1592 - name: unexported-naming 1593 severity: warning 1594 disabled: false 1595 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unexported-return 1596 - name: unexported-return 1597 severity: warning 1598 disabled: false 1599 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unhandled-error 1600 - name: unhandled-error 1601 severity: warning 1602 disabled: false 1603 arguments: 1604 - "fmt.Printf" 1605 - "myFunction" 1606 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unnecessary-stmt 1607 - name: unnecessary-stmt 1608 severity: warning 1609 disabled: false 1610 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unreachable-code 1611 - name: unreachable-code 1612 severity: warning 1613 disabled: false 1614 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-parameter 1615 - name: unused-parameter 1616 severity: warning 1617 disabled: false 1618 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-receiver 1619 - name: unused-receiver 1620 severity: warning 1621 disabled: false 1622 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#useless-break 1623 - name: useless-break 1624 severity: warning 1625 disabled: false 1626 # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#waitgroup-by-value 1627 - name: waitgroup-by-value 1628 severity: warning 1629 disabled: false 1630 1631 rowserrcheck: 1632 # database/sql is always checked 1633 # Default: [] 1634 packages: 1635 - github.com/jmoiron/sqlx 1636 1637 staticcheck: 1638 # Select the Go version to target. 1639 # Default: "1.13" 1640 # Deprecated: use the global `run.go` instead. 1641 go: "1.15" 1642 # SAxxxx checks in https://staticcheck.io/docs/configuration/options/#checks 1643 # Default: ["*"] 1644 checks: [ "all" ] 1645 1646 stylecheck: 1647 # Select the Go version to target. 1648 # Default: 1.13 1649 # Deprecated: use the global `run.go` instead. 1650 go: "1.15" 1651 # STxxxx checks in https://staticcheck.io/docs/configuration/options/#checks 1652 # Default: ["*"] 1653 checks: [ "all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022" ] 1654 # https://staticcheck.io/docs/configuration/options/#dot_import_whitelist 1655 # Default: ["github.com/mmcloughlin/avo/build", "github.com/mmcloughlin/avo/operand", "github.com/mmcloughlin/avo/reg"] 1656 dot-import-whitelist: 1657 - fmt 1658 # https://staticcheck.io/docs/configuration/options/#initialisms 1659 # 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"] 1660 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" ] 1661 # https://staticcheck.io/docs/configuration/options/#http_status_code_whitelist 1662 # Default: ["200", "400", "404", "500"] 1663 http-status-code-whitelist: [ "200", "400", "404", "500" ] 1664 1665 tagliatelle: 1666 # Check the struck tag name case. 1667 case: 1668 # Use the struct field name to check the name of the struct tag. 1669 # Default: false 1670 use-field-name: true 1671 # `camel` is used for `json` and `yaml` (can be overridden) 1672 # Default: {} 1673 rules: 1674 # Any struct tag type can be used. 1675 # Support string case: `camel`, `pascal`, `kebab`, `snake`, `goCamel`, `goPascal`, `goKebab`, `goSnake`, `upper`, `lower` 1676 json: camel 1677 yaml: camel 1678 xml: camel 1679 bson: camel 1680 avro: snake 1681 mapstructure: kebab 1682 1683 tenv: 1684 # The option `all` will run against whole test files (`_test.go`) regardless of method/function signatures. 1685 # Otherwise, only methods that take `*testing.T`, `*testing.B`, and `testing.TB` as arguments are checked. 1686 # Default: false 1687 all: false 1688 1689 testpackage: 1690 # Regexp pattern to skip files. 1691 # Default: "(export|internal)_test\\.go" 1692 skip-regexp: (export|internal)_test\.go 1693 # List of packages that don't end with _test that tests are allowed to be in. 1694 # Default: "main" 1695 allow-packages: 1696 - example 1697 - main 1698 1699 thelper: 1700 test: 1701 # Check *testing.T is first param (or after context.Context) of helper function. 1702 # Default: true 1703 first: false 1704 # Check *testing.T param has name t. 1705 # Default: true 1706 name: false 1707 # Check t.Helper() begins helper function. 1708 # Default: true 1709 begin: false 1710 benchmark: 1711 # Check *testing.B is first param (or after context.Context) of helper function. 1712 # Default: true 1713 first: false 1714 # Check *testing.B param has name b. 1715 # Default: true 1716 name: false 1717 # Check b.Helper() begins helper function. 1718 # Default: true 1719 begin: false 1720 tb: 1721 # Check *testing.TB is first param (or after context.Context) of helper function. 1722 # Default: true 1723 first: false 1724 # Check *testing.TB param has name tb. 1725 # Default: true 1726 name: false 1727 # Check tb.Helper() begins helper function. 1728 # Default: true 1729 begin: false 1730 fuzz: 1731 # Check *testing.F is first param (or after context.Context) of helper function. 1732 # Default: true 1733 first: false 1734 # Check *testing.F param has name f. 1735 # Default: true 1736 name: false 1737 # Check f.Helper() begins helper function. 1738 # Default: true 1739 begin: false 1740 1741 usestdlibvars: 1742 # Suggest the use of http.MethodXX. 1743 # Default: true 1744 http-method: false 1745 # Suggest the use of http.StatusXX. 1746 # Default: true 1747 http-status-code: false 1748 # Suggest the use of time.Weekday.String(). 1749 # Default: true 1750 time-weekday: true 1751 # Suggest the use of time.Month.String(). 1752 # Default: false 1753 time-month: true 1754 # Suggest the use of time.Layout. 1755 # Default: false 1756 time-layout: true 1757 # Suggest the use of crypto.Hash.String(). 1758 # Default: false 1759 crypto-hash: true 1760 # Suggest the use of rpc.DefaultXXPath. 1761 # Default: false 1762 default-rpc-path: true 1763 # Suggest the use of os.DevNull. 1764 # Default: false 1765 os-dev-null: true 1766 # Suggest the use of sql.LevelXX.String(). 1767 # Default: false 1768 sql-isolation-level: true 1769 # Suggest the use of tls.SignatureScheme.String(). 1770 # Default: false 1771 tls-signature-scheme: true 1772 # Suggest the use of constant.Kind.String(). 1773 # Default: false 1774 constant-kind: true 1775 1776 unparam: 1777 # Inspect exported functions. 1778 # 1779 # Set to true if no external program/library imports your code. 1780 # XXX: if you enable this setting, unparam will report a lot of false-positives in text editors: 1781 # if it's called for subdir of a project it can't find external interfaces. All text editor integrations 1782 # with golangci-lint call it on a directory with the changed file. 1783 # 1784 # Default: false 1785 check-exported: true 1786 1787 varcheck: 1788 # Check usage of exported fields and variables. 1789 # Default: false 1790 exported-fields: true 1791 1792 varnamelen: 1793 # The longest distance, in source lines, that is being considered a "small scope". 1794 # Variables used in at most this many lines will be ignored. 1795 # Default: 5 1796 max-distance: 6 1797 # The minimum length of a variable's name that is considered "long". 1798 # Variable names that are at least this long will be ignored. 1799 # Default: 3 1800 min-name-length: 2 1801 # Check method receivers. 1802 # Default: false 1803 check-receiver: true 1804 # Check named return values. 1805 # Default: false 1806 check-return: true 1807 # Check type parameters. 1808 # Default: false 1809 check-type-param: true 1810 # Ignore "ok" variables that hold the bool return value of a type assertion. 1811 # Default: false 1812 ignore-type-assert-ok: true 1813 # Ignore "ok" variables that hold the bool return value of a map index. 1814 # Default: false 1815 ignore-map-index-ok: true 1816 # Ignore "ok" variables that hold the bool return value of a channel receive. 1817 # Default: false 1818 ignore-chan-recv-ok: true 1819 # Optional list of variable names that should be ignored completely. 1820 # Default: [] 1821 ignore-names: 1822 - err 1823 # Optional list of variable declarations that should be ignored completely. 1824 # Entries must be in one of the following forms (see below for examples): 1825 # - for variables, parameters, named return values, method receivers, or type parameters: 1826 # <name> <type> (<type> can also be a pointer/slice/map/chan/...) 1827 # - for constants: const <name> 1828 # 1829 # Default: [] 1830 ignore-decls: 1831 - c echo.Context 1832 - t testing.T 1833 - f *foo.Bar 1834 - e error 1835 - i int 1836 - const C 1837 - T any 1838 - m map[string]int 1839 1840 whitespace: 1841 # Enforces newlines (or comments) after every multi-line if statement. 1842 # Default: false 1843 multi-if: true 1844 # Enforces newlines (or comments) after every multi-line function signature. 1845 # Default: false 1846 multi-func: true 1847 1848 wrapcheck: 1849 # An array of strings that specify substrings of signatures to ignore. 1850 # If this set, it will override the default set of ignored signatures. 1851 # See https://github.com/tomarrell/wrapcheck#configuration for more information. 1852 # Default: [".Errorf(", "errors.New(", "errors.Unwrap(", ".Wrap(", ".Wrapf(", ".WithMessage(", ".WithMessagef(", ".WithStack("] 1853 ignoreSigs: 1854 - .Errorf( 1855 - errors.New( 1856 - errors.Unwrap( 1857 - .Wrap( 1858 - .Wrapf( 1859 - .WithMessage( 1860 - .WithMessagef( 1861 - .WithStack( 1862 # An array of strings that specify regular expressions of signatures to ignore. 1863 # Default: [] 1864 ignoreSigRegexps: 1865 - \.New.*Error\( 1866 # An array of strings that specify globs of packages to ignore. 1867 # Default: [] 1868 ignorePackageGlobs: 1869 - encoding/* 1870 - github.com/pkg/* 1871 # An array of strings that specify regular expressions of interfaces to ignore. 1872 # Default: [] 1873 ignoreInterfaceRegexps: 1874 - ^(?i)c(?-i)ach(ing|e) 1875 1876 wsl: 1877 # See https://github.com/bombsimon/wsl/blob/master/doc/configuration.md for documentation of available settings. 1878 # These are the defaults for `golangci-lint`. 1879 1880 # Do strict checking when assigning from append (x = append(x, y)). If 1881 # this is set to true - the append call must append either a variable 1882 # assigned, called or used on the line above. 1883 strict-append: true 1884 1885 # Allows assignments to be cuddled with variables used in calls on 1886 # line above and calls to be cuddled with assignments of variables 1887 # used in call on line above. 1888 allow-assign-and-call: true 1889 1890 # Allows assignments to be cuddled with anything. 1891 allow-assign-and-anything: false 1892 1893 # Allows cuddling to assignments even if they span over multiple lines. 1894 allow-multiline-assign: true 1895 1896 # If the number of lines in a case block is equal to or lager than this 1897 # number, the case *must* end white a newline. 1898 force-case-trailing-whitespace: 0 1899 1900 # Allow blocks to end with comments. 1901 allow-trailing-comment: false 1902 1903 # Allow multiple comments in the beginning of a block separated with newline. 1904 allow-separated-leading-comment: false 1905 1906 # Allow multiple var/declaration statements to be cuddled. 1907 allow-cuddle-declarations: false 1908 1909 # Aa list of call idents that everything can be cuddled with. 1910 # Defaults to calls looking like locks. 1911 allow-cuddle-with-calls: [ "Lock", "RLock" ] 1912 1913 # AllowCuddleWithRHS is a list of right hand side variables that is allowed 1914 # to be cuddled with anything. Defaults to assignments or calls looking 1915 # like unlocks. 1916 allow-cuddle-with-rhs: [ "Unlock", "RUnlock" ] 1917 1918 # Causes an error when an If statement that checks an error variable doesn't 1919 # cuddle with the assignment of that variable. 1920 enforce-err-cuddling: false 1921 1922 # When enforce-err-cuddling is enabled this is a list of names 1923 # used for error variables to check for in the conditional. 1924 error-variable-names: [ "err" ] 1925 1926 # Causes an error if a short declaration (:=) cuddles with anything other than 1927 # another short declaration. 1928 # This logic overrides enforce-err-cuddling among others. 1929 force-short-decl-cuddling: false 1930 1931 # The custom section can be used to define linter plugins to be loaded at runtime. 1932 # See README documentation for more info. 1933 custom: 1934 # Each custom linter should have a unique name. 1935 example: 1936 # The path to the plugin *.so. Can be absolute or local. 1937 # Required for each custom linter. 1938 path: /path/to/example.so 1939 # The description of the linter. 1940 # Optional. 1941 description: This is an example usage of a plugin linter. 1942 # Intended to point to the repo location of the linter. 1943 # Optional. 1944 original-url: github.com/golangci/example-linter 1945 1946 1947 linters: 1948 # Disable all linters. 1949 # Default: false 1950 disable-all: true 1951 # Enable specific linter 1952 # https://golangci-lint.run/usage/linters/#enabled-by-default 1953 enable: 1954 - asasalint 1955 - asciicheck 1956 - bidichk 1957 - bodyclose 1958 - containedctx 1959 - contextcheck 1960 - cyclop 1961 - deadcode 1962 - decorder 1963 - depguard 1964 - dogsled 1965 - dupl 1966 - dupword 1967 - durationcheck 1968 - errcheck 1969 - errchkjson 1970 - errname 1971 - errorlint 1972 - execinquery 1973 - exhaustive 1974 - exhaustivestruct 1975 - exhaustruct 1976 - exportloopref 1977 - forbidigo 1978 - forcetypeassert 1979 - funlen 1980 - gci 1981 - gochecknoglobals 1982 - gochecknoinits 1983 - gocognit 1984 - goconst 1985 - gocritic 1986 - gocyclo 1987 - godot 1988 - godox 1989 - goerr113 1990 - gofmt 1991 - gofumpt 1992 - goheader 1993 - goimports 1994 - golint 1995 - gomnd 1996 - gomoddirectives 1997 - gomodguard 1998 - goprintffuncname 1999 - gosec 2000 - gosimple 2001 - govet 2002 - grouper 2003 - ifshort 2004 - importas 2005 - ineffassign 2006 - interfacebloat 2007 - interfacer 2008 - ireturn 2009 - lll 2010 - loggercheck 2011 - maintidx 2012 - makezero 2013 - maligned 2014 - misspell 2015 - nakedret 2016 - nestif 2017 - nilerr 2018 - nilnil 2019 - nlreturn 2020 - noctx 2021 - nolintlint 2022 - nonamedreturns 2023 - nosnakecase 2024 - nosprintfhostport 2025 - paralleltest 2026 - prealloc 2027 - predeclared 2028 - promlinter 2029 - reassign 2030 - revive 2031 - rowserrcheck 2032 - scopelint 2033 - sqlclosecheck 2034 - staticcheck 2035 - structcheck 2036 - stylecheck 2037 - tagliatelle 2038 - tenv 2039 - testableexamples 2040 - testpackage 2041 - thelper 2042 - tparallel 2043 - typecheck 2044 - unconvert 2045 - unparam 2046 - unused 2047 - usestdlibvars 2048 - varcheck 2049 - varnamelen 2050 - wastedassign 2051 - whitespace 2052 - wrapcheck 2053 - wsl 2054 2055 # Enable all available linters. 2056 # Default: false 2057 enable-all: true 2058 # Disable specific linter 2059 # https://golangci-lint.run/usage/linters/#disabled-by-default 2060 disable: 2061 - asasalint 2062 - asciicheck 2063 - bidichk 2064 - bodyclose 2065 - containedctx 2066 - contextcheck 2067 - cyclop 2068 - deadcode 2069 - decorder 2070 - depguard 2071 - dogsled 2072 - dupl 2073 - dupword 2074 - durationcheck 2075 - errcheck 2076 - errchkjson 2077 - errname 2078 - errorlint 2079 - execinquery 2080 - exhaustive 2081 - exhaustivestruct 2082 - exhaustruct 2083 - exportloopref 2084 - forbidigo 2085 - forcetypeassert 2086 - funlen 2087 - gci 2088 - gochecknoglobals 2089 - gochecknoinits 2090 - gocognit 2091 - goconst 2092 - gocritic 2093 - gocyclo 2094 - godot 2095 - godox 2096 - goerr113 2097 - gofmt 2098 - gofumpt 2099 - goheader 2100 - goimports 2101 - golint 2102 - gomnd 2103 - gomoddirectives 2104 - gomodguard 2105 - goprintffuncname 2106 - gosec 2107 - gosimple 2108 - govet 2109 - grouper 2110 - ifshort 2111 - importas 2112 - ineffassign 2113 - interfacebloat 2114 - interfacer 2115 - ireturn 2116 - lll 2117 - loggercheck 2118 - maintidx 2119 - makezero 2120 - maligned 2121 - misspell 2122 - nakedret 2123 - nestif 2124 - nilerr 2125 - nilnil 2126 - nlreturn 2127 - noctx 2128 - nolintlint 2129 - nonamedreturns 2130 - nosnakecase 2131 - nosprintfhostport 2132 - paralleltest 2133 - prealloc 2134 - predeclared 2135 - promlinter 2136 - reassign 2137 - revive 2138 - rowserrcheck 2139 - scopelint 2140 - sqlclosecheck 2141 - staticcheck 2142 - structcheck 2143 - stylecheck 2144 - tagliatelle 2145 - tenv 2146 - testableexamples 2147 - testpackage 2148 - thelper 2149 - tparallel 2150 - typecheck 2151 - unconvert 2152 - unparam 2153 - unused 2154 - usestdlibvars 2155 - varcheck 2156 - varnamelen 2157 - wastedassign 2158 - whitespace 2159 - wrapcheck 2160 - wsl 2161 2162 # Enable presets. 2163 # https://golangci-lint.run/usage/linters 2164 presets: 2165 - bugs 2166 - comment 2167 - complexity 2168 - error 2169 - format 2170 - import 2171 - metalinter 2172 - module 2173 - performance 2174 - sql 2175 - style 2176 - test 2177 - unused 2178 2179 # Run only fast linters from enabled linters set (first run won't be fast) 2180 # Default: false 2181 fast: true 2182 2183 2184 issues: 2185 # List of regexps of issue texts to exclude. 2186 # 2187 # But independently of this option we use default exclude patterns, 2188 # it can be disabled by `exclude-use-default: false`. 2189 # To list all excluded by default patterns execute `golangci-lint run --help` 2190 # 2191 # Default: https://golangci-lint.run/usage/false-positives/#default-exclusions 2192 exclude: 2193 - abcdef 2194 2195 # Excluding configuration per-path, per-linter, per-text and per-source 2196 exclude-rules: 2197 # Exclude some linters from running on tests files. 2198 - path: _test\.go 2199 linters: 2200 - gocyclo 2201 - errcheck 2202 - dupl 2203 - gosec 2204 2205 # Exclude known linters from partially hard-vendored code, 2206 # which is impossible to exclude via `nolint` comments. 2207 # `/` will be replaced by current OS file path separator to properly work on Windows. 2208 - path: internal/hmac/ 2209 text: "weak cryptographic primitive" 2210 linters: 2211 - gosec 2212 2213 # Exclude some `staticcheck` messages. 2214 - linters: 2215 - staticcheck 2216 text: "SA9003:" 2217 2218 # Exclude `lll` issues for long lines with `go:generate`. 2219 - linters: 2220 - lll 2221 source: "^//go:generate " 2222 2223 # Independently of option `exclude` we use default exclude patterns, 2224 # it can be disabled by this option. 2225 # To list all excluded by default patterns execute `golangci-lint run --help`. 2226 # Default: true. 2227 exclude-use-default: false 2228 2229 # If set to true exclude and exclude-rules regular expressions become case-sensitive. 2230 # Default: false 2231 exclude-case-sensitive: false 2232 2233 # The list of ids of default excludes to include or disable. 2234 # https://golangci-lint.run/usage/false-positives/#default-exclusions 2235 # Default: [] 2236 include: 2237 - EXC0001 2238 - EXC0002 2239 - EXC0003 2240 - EXC0004 2241 - EXC0005 2242 - EXC0006 2243 - EXC0007 2244 - EXC0008 2245 - EXC0009 2246 - EXC0010 2247 - EXC0011 2248 - EXC0012 2249 - EXC0013 2250 - EXC0014 2251 - EXC0015 2252 2253 # Maximum issues count per one linter. 2254 # Set to 0 to disable. 2255 # Default: 50 2256 max-issues-per-linter: 0 2257 2258 # Maximum count of issues with the same text. 2259 # Set to 0 to disable. 2260 # Default: 3 2261 max-same-issues: 0 2262 2263 # Show only new issues: if there are unstaged changes or untracked files, 2264 # only those changes are analyzed, else only changes in HEAD~ are analyzed. 2265 # It's a super-useful option for integration of golangci-lint into existing large codebase. 2266 # It's not practical to fix all existing issues at the moment of integration: 2267 # much better don't allow issues in new code. 2268 # 2269 # Default: false. 2270 new: true 2271 2272 # Show only new issues created after git revision `REV`. 2273 new-from-rev: HEAD 2274 2275 # Show only new issues created in git patch with set file path. 2276 new-from-patch: path/to/patch/file 2277 2278 # Fix found issues (if it's supported by the linter). 2279 fix: true 2280 2281 2282 severity: 2283 # Set the default severity for issues. 2284 # 2285 # If severity rules are defined and the issues do not match or no severity is provided to the rule 2286 # this will be the default severity applied. 2287 # Severities should match the supported severity names of the selected out format. 2288 # - Code climate: https://docs.codeclimate.com/docs/issues#issue-severity 2289 # - Checkstyle: https://checkstyle.sourceforge.io/property_types.html#SeverityLevel 2290 # - GitHub: https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message 2291 # 2292 # Default value is an empty string. 2293 default-severity: error 2294 2295 # If set to true `severity-rules` regular expressions become case-sensitive. 2296 # Default: false 2297 case-sensitive: true 2298 2299 # When a list of severity rules are provided, severity information will be added to lint issues. 2300 # Severity rules have the same filtering capability as exclude rules 2301 # except you are allowed to specify one matcher per severity rule. 2302 # Only affects out formats that support setting severity information. 2303 # 2304 # Default: [] 2305 rules: 2306 - linters: 2307 - dupl 2308 severity: info