github.com/k8snetworkplumbingwg/sriov-network-operator@v1.2.1-0.20240408194816-2d2e5a45d453/.golangci.yml (about)

     1  # Tested with golangci-lint ver. 1.37
     2  run:
     3    timeout: 10m
     4    skip-dirs:
     5      - vendor/
     6      - .github/
     7      - deployment/
     8      - doc/
     9      - bindata/
    10      - pkg/client
    11  linters-settings:
    12    depguard:
    13      rules:
    14        main:
    15          deny:
    16            - pkg: github.com/sirupsen/logrus
    17              desc: "logging is allowed only by logutils.Log"
    18    dupl:
    19      threshold: 100
    20    funlen:
    21      lines: 100
    22      statements: 50
    23    goconst:
    24      min-len: 2
    25      min-occurrences: 2
    26      ignore-tests: true
    27    gocritic:
    28      enabled-tags:
    29        - diagnostic
    30        - experimental
    31        - opinionated
    32        - performance
    33        - style
    34      disabled-checks:
    35        - dupImport # https://github.com/go-critic/go-critic/issues/845
    36        - ifElseChain
    37        - octalLiteral
    38        - whyNoLint
    39        - wrapperFunc
    40        - unnamedResult
    41      settings:
    42        hugeParam:
    43          sizeThreshold: 512
    44        rangeValCopy:
    45          sizeThreshold: 512
    46    gocyclo:
    47      min-complexity: 15
    48    goimports:
    49      local-prefixes: github.com/k8snetworkplumbingwg/sriov-network-operator
    50    gomnd:
    51      settings:
    52        mnd:
    53          # don't include the "operation" and "assign"
    54          checks: argument,case,condition,return
    55    lll:
    56      line-length: 140
    57    misspell:
    58      locale: US
    59    prealloc:
    60      # Report preallocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them.
    61      # True by default.
    62      simple: true
    63      range-loops: true # Report preallocation suggestions on range loops, true by default
    64      for-loops: false # Report preallocation suggestions on for loops, false by default
    65    stylecheck:
    66      dot-import-whitelist: 
    67        - github.com/onsi/ginkgo/v2
    68        - github.com/onsi/gomega
    69        - github.com/onsi/gomega/gstruct
    70  
    71  linters:
    72    # please, do not use `enable-all`: it's deprecated and will be removed soon.
    73    # inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
    74    disable-all: true
    75    enable:
    76      - bodyclose
    77      - depguard
    78      - dogsled
    79      # TODO fix issues- dupl
    80      # TODO fix issues- errcheck
    81      - exportloopref
    82      - exhaustive
    83      # TODO fix issues- funlen
    84        #- gochecknoinits
    85      - goconst
    86      # TODO fix issues- gocritic
    87      # TODO fix issues- gocyclo
    88      - gofmt
    89      - goimports
    90      # TODO fix issues- gomnd
    91      - goprintffuncname
    92      # TODO fix issues- gosec
    93      - gosimple
    94        #- govet
    95      - ineffassign
    96      # TODO fix issues- lll
    97      - misspell
    98      # TODO fix issues- nakedret
    99      # TODO fix issues- prealloc
   100        #- scopelint
   101      # TODO fix issues- staticcheck
   102      - stylecheck
   103      - typecheck
   104      - unconvert
   105      # TODO fix issues- unparam
   106      - unused
   107      - whitespace
   108  
   109  issues:
   110    # Excluding configuration per-path, per-linter, per-text and per-source
   111    exclude-rules:
   112      - path: _test\.go
   113        linters:
   114          - gomnd
   115          - gosec
   116          - dupl
   117          - lll
   118          - stylecheck
   119          - goconst
   120      - path: test/conformance/tests
   121        linters:
   122          - goconst
   123