im-kulikov/helium

View on GitHub
.golangci.yml

Summary

Maintainability
Test Coverage
linters:
  enable-all: false
  enable:
    - unparam
    - whitespace
    - unconvert
    - bodyclose
    - gofmt
    - gocritic
    - godot
    - prealloc
    - unconvert
    - lll
    - cyclop
    - gci
    - gosec
    - prealloc
    - revive
    - gochecknoglobals
    - funlen
  disable:
    - errcheck
    - ineffassign

linters-settings:
  govet:
    check-shadowing: true
  golint:
    min-confidence: 0
  gocyclo:
    min-complexity: 20
  cyclop:
    min-complexity: 20
    max-complexity: 30
  gci:
    custom-order: true
    sections:
      - standard
      - default
      - prefix(github.com/im-kulikov/helium)
  dupl:
    threshold: 100
  goconst:
    min-len: 2
    min-occurrences: 2
  gomoddirectives:
    # List of allowed `replace` directives. Default is empty.
    replace-allow-list:
      - bou.ke/monkey
  lll:
    line-length: 140
  funlen:
    lines: 130
    statements: 70
  nestif:
    # minimal complexity of if statements to report
    min-complexity: 6
  gocognit:
    min-complexity: 35

issues:
  exclude-rules:
    - path: mock # We avoid warnings about comments for package and public functions in mock package.
      linters:
        - golint
    - path: _test\.go
      linters:
        - goconst
        - scopelint # To avoid warnings in table-driven tests combined with t.Run
        - gochecknoglobals
        - funlen
        - dupl
        - govet
        - staticcheck
        - gocyclo
        - errcheck
        - nlreturn
    - path: slack_incoming_messages\.go
      linters:
        - dupl
    - path: slack_outgoing_messages\.go
      linters:
        - dupl
    - path: job\.go
      linters:
        - dupl
    - path: postgres\.go
      linters:
        - errcheck
    - path: parse_incoming_job\.go
      linters:
        - funlen
        - gocyclo
  exclude-use-default: false
  exclude:
    # golint: Package comment check for every file
    - should have a package comment, unless

    # govet: Common false positives
    - (possible misuse of unsafe.Pointer|should have signature)

    # gosec: Too many false-positives on 'unsafe' usage
    - Use of unsafe calls should be audited

    # gosec: Too many false-positives for parametrized shell calls
    - Subprocess launch(ed with variable|ing should be audited)

    # gosec: Duplicated errcheck checks
    - G104

    # gosec: Too many issues in popular repos
    - (Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less)

    # gosec: False positive is triggered by 'src, err := ioutil.ReadFile(filename)'
    - Potential file inclusion via variable

    # gochecknoglobals: allow version variable
    - "`version` is a global variable"

    # revive: should have a package comment
    - "package-comments: should have a package comment"