github.com/jenkins-x/jx-api@v0.0.24/.golangci.yml (about)

     1  linters-settings:
     2    depguard:
     3      list-type: blacklist
     4      packages:
     5        # logging is allowed only by logutils.Log, logrus
     6        # is allowed to use only in logutils package
     7        - github.com/sirupsen/logrus
     8        - github.com/jenkins-x/jx/
     9        - github.com/jenkins-x/jx/v2/
    10      packages-with-error-message:
    11        - github.com/sirupsen/logrus: "logging is allowed only by jenkins-x/jx-logging"
    12        - github.com/jenkins-x/jx/: "you should not directly import jx"
    13        - github.com/jenkins-x/jx/v2/: "you should not directly import jx v2"
    14    dupl:
    15      threshold: 100
    16    exhaustive:
    17      default-signifies-exhaustive: false
    18    funlen:
    19      lines: 200
    20      statements: 150
    21    goconst:
    22      min-len: 3
    23      min-occurrences: 3
    24    gocritic:
    25      enabled-tags:
    26        - diagnostic
    27        - experimental
    28        - opinionated
    29        - performance
    30        - style
    31      disabled-checks:
    32        - dupImport # https://github.com/go-critic/go-critic/issues/845
    33        - ifElseChain
    34        - octalLiteral
    35        - whyNoLint
    36        - wrapperFunc
    37    gocyclo:
    38      min-complexity: 15
    39    goimports:
    40    golint:
    41      min-confidence: 0
    42    gomnd:
    43      settings:
    44        mnd:
    45          # don't include the "operation" and "assign"
    46          checks: argument,case,condition,return
    47    govet:
    48      check-shadowing: true
    49      settings:
    50        printf:
    51          funcs:
    52            - (github.com/jenkins-x/jx-logging/pkg/log/Logger()).Debugf
    53            - (github.com/jenkins-x/jx-logging/pkg/log/Logger()).Infof
    54            - (github.com/jenkins-x/jx-logging/pkg/log/Logger()).Warnf
    55            - (github.com/jenkins-x/jx-logging/pkg/log/Logger()).Errorf
    56            - (github.com/jenkins-x/jx-logging/pkg/log/Logger()).Fatalf
    57    lll:
    58      line-length: 140
    59    maligned:
    60      suggest-new: true
    61    misspell:
    62    nolintlint:
    63      allow-leading-space: true # don't require machine-readable nolint directives (i.e. with no leading space)
    64      allow-unused: false # report any unused nolint directives
    65      require-explanation: false # don't require an explanation for nolint directives
    66      require-specific: false # don't require nolint directives to be specific about which linter is being skipped
    67  linters:
    68    # please, do not use `enable-all`: it's deprecated and will be removed soon.
    69    # inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
    70    disable-all: true
    71    enable:
    72      - asciicheck
    73      - bodyclose
    74      - deadcode
    75      - depguard
    76      - dogsled
    77      - dupl
    78      - errcheck
    79      - funlen
    80      - goconst
    81      - gofmt
    82      - goimports
    83      - goprintffuncname
    84      - gosec
    85      - gosimple
    86      - ineffassign
    87      - interfacer
    88      - misspell
    89      - nakedret
    90      - rowserrcheck
    91      - staticcheck
    92      - structcheck
    93      - typecheck
    94      - unconvert
    95      - unparam
    96      - unused
    97      - varcheck
    98      - testpackage
    99    # don't enable:
   100    # - gochecknoinits
   101    # - gocritic
   102    # - gocyclo
   103    # - stylecheck
   104    # - golint
   105    # - lll
   106    # - govet
   107    # - whitespace
   108    # - exhaustive (TODO: enable after next release; current release at time of writing is v1.27)
   109    # - gochecknoglobals
   110    # - gocognit
   111    # - godot
   112    # - godox
   113    # - goerr113
   114    # - maligned
   115    # - nestif
   116    # - prealloc
   117    # - wsl
   118    # - nolintlint
   119    # - gomnd
   120    # - scopelint
   121  issues:
   122    # Excluding configuration per-path, per-linter, per-text and per-source
   123    exclude-rules:
   124      - path: _test\.go
   125        linters:
   126          - gomnd
   127      - path: _expansion_test\.go
   128        linters:
   129          - testpackage
   130      # https://github.com/go-critic/go-critic/issues/926
   131      - linters:
   132          - gocritic
   133        text: "unnecessaryDefer:"
   134  run:
   135    skip-dirs:
   136      - test/testdata_etc
   137      - internal/cache
   138      - internal/renameio
   139      - internal/robustio
   140  # golangci.com configuration
   141  # https://github.com/golangci/golangci/wiki/Configuration
   142  service:
   143    golangci-lint-version: 1.27.x # use the fixed version to not introduce new linters unexpectedly
   144    prepare:
   145      - echo "here I can run custom commands, but no preparation needed for this repo"