github.com/filecoin-project/bacalhau@v0.3.23-0.20230228154132-45c989550ace/.golangci.yml (about)

     1  linters-settings:
     2    depguard:
     3      list-type: denylist
     4      packages:
     5        - github.com/sirupsen/logrus
     6      packages-with-error-message:
     7        - github.com/sirupsen/logrus: "logging is allowed only by zerolog"
     8    dupl:
     9      threshold: 100
    10    funlen:
    11      lines: 100
    12      statements: 100
    13    goconst:
    14      min-len: 2
    15      min-occurrences: 3
    16    gocritic:
    17      enabled-tags:
    18        - diagnostic
    19        - experimental
    20        - opinionated
    21        - performance
    22        - style
    23      disabled-checks:
    24        - dupImport # https://github.com/go-critic/go-critic/issues/845
    25        - ifElseChain
    26        - octalLiteral
    27        - whyNoLint
    28        - wrapperFunc
    29        - hugeParam
    30        - importShadow
    31    gocyclo:
    32      min-complexity: 18
    33    goimports:
    34      local-prefixes: github.com/golangci/golangci-lint
    35    gomnd:
    36      # don't include the "operation" and "assign"
    37      checks:
    38        - argument
    39        - case
    40        - condition
    41        - return
    42      ignored-numbers:
    43        - "0"
    44        - "1"
    45        - "2"
    46        - "3"
    47      ignored-functions:
    48        - strings.SplitN
    49  
    50    govet:
    51      check-shadowing: true
    52      # settings:
    53      #   printf:
    54      #     funcs:
    55      #       - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
    56      #       - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
    57      #       - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
    58      #       - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
    59    lll:
    60      line-length: 140
    61    misspell:
    62      locale: US
    63    nolintlint:
    64      allow-leading-space: true # don't require machine-readable nolint directives (i.e. with no leading space)
    65      allow-unused: true # report any unused nolint directives
    66      require-explanation: false # don't require an explanation for nolint directives
    67      require-specific: false # don't require nolint directives to be specific about which linter is being skipped
    68  
    69  # TODO #842 Check gocritic regularly to see if they support generics (finally)
    70  linters:
    71    disable-all: true
    72    enable:
    73      - bodyclose
    74      - unused
    75      - depguard
    76      - dogsled
    77      - errcheck
    78      - exportloopref
    79      - funlen
    80      - gochecknoinits
    81      - goconst
    82      # - gocritic
    83      - gocyclo
    84      - gofmt
    85      - goimports
    86      - gomnd
    87      - goprintffuncname
    88      - gosec
    89      - gosimple
    90      - govet
    91      - ineffassign
    92      - lll
    93      - misspell
    94      - nakedret
    95      - noctx
    96      - nolintlint
    97      - staticcheck
    98      - stylecheck
    99      - typecheck
   100      - unconvert
   101      - unused
   102      - whitespace
   103  
   104  # Options for analysis running.
   105  run:
   106    # The default concurrency value is the number of available CPU.
   107    # concurrency: 16
   108    # Timeout for analysis, e.g. 30s, 5m.
   109    # Default: 1m
   110    timeout: 5m
   111    # Exit code when at least one issue was found.
   112    # Default: 1
   113    issues-exit-code: 2
   114    # Include test files or not.
   115    # Default: true
   116    tests: false
   117    # List of build tags, all linters use it.
   118    # Default: [].
   119    # build-tags:
   120    #   - bacalhau-ci-build
   121    # Which dirs to skip: issues from them won't be reported.
   122    # Can use regexp here: `generated.*`, regexp is applied on full path.
   123    # Default value is empty list,
   124    # but default dirs are skipped independently of this option's value (see skip-dirs-use-default).
   125    # "/" will be replaced by current OS file path separator to properly work on Windows.
   126    skip-dirs:
   127      - experimental$
   128      - vendor$
   129      - viz$
   130      - ops$
   131      - testdata$
   132    # Enables skipping of directories:
   133    # - vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
   134    # Default: true
   135    skip-dirs-use-default: false
   136    # Which files to skip: they will be analyzed, but issues from them won't be reported.
   137    # Default value is empty list,
   138    # but there is no need to include all autogenerated files,
   139    # we confidently recognize autogenerated files.
   140    # If it's not please let us know.
   141    # "/" will be replaced by current OS file path separator to properly work on Windows.
   142    # skip-files:
   143    # - ".*\\.my\\.go$"
   144    # - lib/bad.go
   145    # If set we pass it to "go list -mod={option}". From "go help modules":
   146    # If invoked with -mod=readonly, the go command is disallowed from the implicit
   147    # automatic updating of go.mod described above. Instead, it fails when any changes
   148    # to go.mod are needed. This setting is most useful to check that go.mod does
   149    # not need updates, such as in a continuous integration and testing system.
   150    # If invoked with -mod=vendor, the go command assumes that the vendor
   151    # directory holds the correct copies of dependencies and ignores
   152    # the dependency descriptions in go.mod.
   153    #
   154    # Allowed values: readonly|vendor|mod
   155    # By default, it isn't set.
   156    modules-download-mode: readonly
   157    # Allow multiple parallel golangci-lint instances running.
   158    # If false (default) - golangci-lint acquires file lock on start.
   159    allow-parallel-runners: false