# Options for analysis running.
run:
  # Timeout for analysis, e.g. 30s, 5m.
  # Default: 1m
  timeout: 10m
  # Exit code when at least one issue was found.
  # Default: 1
  issues-exit-code: 1
  # Include test files or not.
  # Default: true
  tests: true
  # Which dirs to skip: issues from them won't be reported.
  # Can use regexp here: `generated.*`, regexp is applied on full path.
  # Default value is empty list,
  # but default dirs are skipped independently of this option's value (see skip-dirs-use-default).
  # "/" will be replaced by current OS file path separator to properly work on Windows.
  skip-dirs:
    - infra$
    - vendor$
  # Which files to skip: they will be analyzed, but issues from them won't be reported.
  # Default value is empty list,
  # but there is no need to include all autogenerated files,
  # we confidently recognize autogenerated files.
  # If it's not please let us know.
  # "/" will be replaced by current OS file path separator to properly work on Windows.
  skip-files:
    - ".*_validators.go"
  # If set we pass it to "go list -mod={option}". From "go help modules":
  # If invoked with -mod=readonly, the go command is disallowed from the implicit
  # automatic updating of go.mod described above. Instead, it fails when any changes
  # to go.mod are needed. This setting is most useful to check that go.mod does
  # not need updates, such as in a continuous integration and testing system.
  # If invoked with -mod=vendor, the go command assumes that the vendor
  # directory holds the correct copies of dependencies and ignores
  # the dependency descriptions in go.mod.
  #
  # Allowed values: readonly|vendor|mod
  # By default, it isn't set.
  modules-download-mode: mod
  # Allow multiple parallel golangci-lint instances running.
  # If false (default) - golangci-lint acquires file lock on start.
  allow-parallel-runners: false
  # Define the Go version limit.
  # Mainly related to generics support in go1.18.
  # Default: use Go version from the go.mod file, fallback on the env var `GOVERSION`, fallback on 1.17
  go: '1.21'


# output configuration options
output:
  # Format: colored-line-number|line-number|json|tab|checkstyle|code-climate|junit-xml|github-actions
  #
  # Multiple can be specified by separating them by comma, output can be provided
  # for each of them by separating format name and path by colon symbol.
  # Output path can be either `stdout`, `stderr` or path to the file to write to.
  # Example: "checkstyle:report.json,colored-line-number"
  #
  # Default: colored-line-number
  format: colored-line-number
  # Print lines of code with issue.
  # Default: true
  print-issued-lines: true
  # Print linter name in the end of issue text.
  # Default: true
  print-linter-name: true
  # Make issues output unique by line.
  # Default: true
  uniq-by-line: true
  # Add a prefix to the output file references.
  # Default is no prefix.
  path-prefix: ""
  # Sort results by: filepath, line and column.
  sort-results: true

linters:
  # Disable all linters.
  # Default: false
  disable-all: false
  # Enable specific linter
  # https://golangci-lint.run/usage/linters/#enabled-by-default-linters
  enable-all: true
  # Disable specific linter
  # https://golangci-lint.run/usage/linters/#disabled-by-default-linters--e--enable
  disable:
    # The repository of the linter has been archived by the owner:
    - depguard
    - godox
    - scopelint
    - exhaustivestruct
    - golint
    - maligned
    - interfacer
    # Annoying things
    - exhaustruct
    - varnamelen
    - wsl
    - paralleltest
    - gochecknoinits # init uses for register prometheus metrics
  # Run only fast linters from enabled linters set (first run won't be fast)
  # Default: false
  fast: false

linters-settings:
  #  revive:
  #    rules:
  #      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unexported-return
  #      - name: unexported-return
  #        severity: warning
  #        disabled: true
  funlen:
    # Checks the number of lines in a function.
    # If lower than 0, disable the check.
    # Default: 60
    lines: 100
    # Checks the number of statements in a function.
    # If lower than 0, disable the check.
    # Default: 40
    statements: 40

  gomnd:
    ignored-functions:
      # Do not check magic value for bit size etc
      - 'strconv.*'
      - 'fixed.New'

  tagliatelle:
    # Check the struck tag name case.
    case:
      rules:
        # Any struct tag type can be used.
        # Support string case: `camel`, `pascal`, `kebab`, `snake`, `goCamel`, `goPascal`, `goKebab`, `goSnake`, `upper`, `lower`
        json: snake

  dupl:
    # Tokens count to trigger issue.
    # Default: 150
    threshold: 200

  asasalint:
    # To specify a set of function names to exclude.
    # The values are merged with the builtin exclusions.
    # The builtin exclusions can be disabled by setting `use-builtin-exclusions` to `false`.
    # Default: ["^(fmt|log|logger|t|)\.(Print|Fprint|Sprint|Fatal|Panic|Error|Warn|Warning|Info|Debug|Log)(|f|ln)$"]
    exclude:
      - Append
      - \.Errorw
      - \.Error
      - \.Warnw
      - \.Warn
      - \.Infow
      - \.Info
      - \.Debugw
      - \.Debug
      - \.With
    # Ignore *_test.go files.
    # Default: false
    ignore-test: true
