linters-settings:
  godox:
    keywords: # default keywords are TODO, BUG, and FIXME, but we override this by ignoring TODO
      - BUG
      - FIXME
  funlen:
    lines: 150
    statements: 80
  cyclop:
    # the minimal code complexity to report
    max-complexity: 26
  gocognit:
    min-complexity: 45

issues:
  exclude-use-default: false
  exclude:
    - Using the variable on range scope `tt` in function literal
    - GetJsonSHA256Fingerprints should be GetJSONSHA256Fingerprints
    - ST1003  # CamelCase variables; see constants/cipher.go
    - missing output for example, go test can't validate it
    - variable 'hasExpiredEntity' is only used in the if-statement
  exclude-rules:
    - path: crypto/key_clear.go
      text: "SA1019"
    - path: crypto/crypto_example_test.go
      text: "G101: Potential hardcoded credentials"
    - path: crypto/encrypt_decrypt_test.go
      text: "Using the variable on range scope"
    - path: crypto/encrypt_decrypt_err_test.go
      text: "Using the variable on range scope"
    - path: crypto/sign_verify_test.go
      text: "Using the variable on range scope"

linters:
  enable-all: true
  disable:
    - dupl              # Tool for code clone detection [fast: true, auto-fix: false]
    - gochecknoglobals  # Checks that no globals are present in Go code [fast: true, auto-fix: false]
    - gochecknoinits    # Checks that no init functions are present in Go code [fast: true, auto-fix: false]
    - golint            # Golint differs from gofmt. Gofmt reformats Go source code, whereas golint prints out style mistakes [fast: true, auto-fix: false]
    - goerr113          # Golang linter to check the errors handling expressions [fast: true, auto-fix: false]
    - gomnd             # An analyzer to detect magic numbers. [fast: true, auto-fix: false]
    - lll               # Reports long lines [fast: true, auto-fix: false]
    - testpackage       # Makes you use a separate _test package [fast: true, auto-fix: false]
    - wsl               # Whitespace Linter - Forces you to use empty lines! [fast: true, auto-fix: false]
    - gofumpt           # Enforce a stricter format than gofmt
    - gci               # Enforce blank lines check
    - nlreturn          # Enforce blank lines for return statements
    - exhaustivestruct  # Enforce structures to be fully filled on instantiation - terrible with openpgp configs
    - paralleltest      # Detects missing usage of t.Parallel() method in your Go test
    - forbidigo         # Static analysis tool to forbid use of particular identifiers
    - thelper           # Enforce test helper formatting
    - revive            # Force CamelCase instead of all caps
    - nilerr            # Force return err when not nil
    - wrapcheck         # Force wrapping of external error TODO: when the bug is fixed update the linter
    - gomoddirectives   # Prohibits the use of replace statements
    - varnamelen        # Forbids short var names
    - ireturn           # Prevents returning interfaces
    - forcetypeassert   # Forces to assert types in tests
    - nonamedreturns    # Disallows named returns
    - exhaustruct       # Forces all structs to be named
    - nosnakecase       # Disallows snake case 
    - depguard
    - nestif