github.com/mailgun/holster/v4@v4.20.0/.golangci.yml (about)

     1  linters:
     2    # Please, do not use `enable-all`: it's deprecated and will be removed soon.
     3    # Inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint.
     4    # Full list of linters - https://golangci-lint.run/usage/linters
     5    disable-all: true
     6    enable:
     7      - bodyclose # https://github.com/timakin/bodyclose
     8      - gomodguard
     9      - errcheck # Mandatory. Do not disable.
    10      - gocritic
    11      - goimports
    12      - gosec
    13      - gosimple
    14      - govet
    15      - noctx
    16      - nolintlint
    17      - ineffassign # Mandatory. Do not disable.
    18      - staticcheck # Mandatory. Do not disable.
    19      - stylecheck
    20      - typecheck
    21      - unused
    22  
    23  # Other linters:
    24  #    - dogsled
    25  #    - dupl
    26  #    - exportloopref
    27  #    - exhaustive # e.g. missing cases in switch of type
    28  #    - funlen
    29  #    - gochecknoinits
    30  #    - gocognit
    31  #    - goconst
    32  #    - gocyclo
    33  #    - goerr113
    34  #    - gofmt
    35  #    - goprintffuncname
    36  #    - lll
    37  #    - misspell
    38  #    - nakedret
    39  #    - nlreturn
    40  #    - prealloc
    41  #    - revive
    42  #    - rowserrcheck
    43  #    - stylecheck
    44  #    - unconvert
    45  #    - unparam
    46  
    47  linters-settings:
    48    gocritic:
    49      enabled-tags:
    50        - diagnostic
    51        - experimental
    52        - opinionated
    53        - performance
    54        - style
    55      disabled-checks:
    56        - dupImport # https://github.com/go-critic/go-critic/issues/845
    57        - whyNoLint # checked by nolintlint linter
    58        - hugeParam # TODO(vtopc): configure(80 bytes is probably not so much) and enable.
    59        - rangeValCopy # TODO(vtopc): configure(disable for tests) and enable.
    60        - appendAssign
    61        - commentedOutCode
    62  
    63    errcheck:
    64      # List of functions to exclude from checking, where each entry is a single function to exclude.
    65      # See https://github.com/kisielk/errcheck#excluding-functions for details.
    66      exclude-functions:
    67        - (io.Closer).Close
    68        - (io.ReadCloser).Close
    69  
    70    govet:
    71      enable-all: true
    72      disable:
    73       - shadow
    74       - fieldalignment
    75  
    76    gomodguard:
    77      blocked:
    78        # List of blocked modules.
    79        # Default: []
    80        modules:
    81          - github.com/golang/protobuf:
    82              recommendations:
    83                - google.golang.org/protobuf
    84              reason: "see https://developers.google.com/protocol-buffers/docs/reference/go/faq#modules"
    85          - github.com/pkg/errors:
    86              recommendations:
    87                - errors
    88                - github.com/mailgun/errors
    89              reason: "Deprecated"
    90  
    91    stylecheck:
    92      # https://staticcheck.io/docs/options#checks
    93      checks: ["all"]
    94  
    95  issues:
    96    # Maximum issues count per one linter. Set to 0 to disable. Default is 50.
    97    max-issues-per-linter: 0
    98  
    99    # Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
   100    max-same-issues: 50
   101  
   102    exclude:
   103      # Some packages have deprecated fields which continue to be useful
   104      - SA1019
   105  
   106    exclude-rules:
   107      # Exclude some rules from tests.
   108      - path: '_test\.go$'
   109        linters:
   110          - gosec
   111          - noctx
   112      - path: '_test\.go$'
   113        text: "unnamedResult:"
   114      - path: '.*mxresolv.*'
   115        linters:
   116          - gosec
   117  
   118  
   119  run:
   120    # include test files or not, default is true
   121    tests: true
   122  
   123    # Timeout for analysis, e.g. 30s, 5m.
   124    # Default: 1m
   125    timeout: 5m