github.com/Heebron/moby@v0.0.0-20221111184709-6eab4f55faf7/hack/validate/golangci-lint.yml (about)

     1  linters:
     2    enable:
     3      - depguard
     4      - goimports
     5      - gosec
     6      - gosimple
     7      - govet
     8      - ineffassign
     9      - misspell
    10      - revive
    11      - staticcheck
    12      - typecheck
    13      - unconvert
    14      - unused
    15  
    16    disable:
    17      - errcheck
    18  
    19    run:
    20      concurrency: 2
    21      modules-download-mode: vendor
    22  
    23      skip-dirs:
    24        - docs
    25  
    26  linters-settings:
    27    govet:
    28      check-shadowing: false
    29    depguard:
    30      list-type: blacklist
    31      include-go-root: true
    32      packages:
    33        # The io/ioutil package has been deprecated.
    34        # https://go.dev/doc/go1.16#ioutil
    35        - io/ioutil
    36    revive:
    37      rules:
    38        # FIXME make sure all packages have a description. Currently, there's many packages without.
    39        - name: package-comments
    40          disabled: true
    41  issues:
    42    # The default exclusion rules are a bit too permissive, so copying the relevant ones below
    43    exclude-use-default: false
    44  
    45    exclude-rules:
    46      # We prefer to use an "exclude-list" so that new "default" exclusions are not
    47      # automatically inherited. We can decide whether or not to follow upstream
    48      # defaults when updating golang-ci-lint versions.
    49      # Unfortunately, this means we have to copy the whole exclusion pattern, as
    50      # (unlike the "include" option), the "exclude" option does not take exclusion
    51      # ID's.
    52      #
    53      # These exclusion patterns are copied from the default excluses at:
    54      # https://github.com/golangci/golangci-lint/blob/v1.46.2/pkg/config/issues.go#L10-L104
    55  
    56      # EXC0001
    57      - text: "Error return value of .((os\\.)?std(out|err)\\..*|.*Close|.*Flush|os\\.Remove(All)?|.*print(f|ln)?|os\\.(Un)?Setenv). is not checked"
    58        linters:
    59          - errcheck
    60      # EXC0006
    61      - text: "Use of unsafe calls should be audited"
    62        linters:
    63          - gosec
    64      # EXC0007
    65      - text: "Subprocess launch(ed with variable|ing should be audited)"
    66        linters:
    67          - gosec
    68      # EXC0008
    69      # TODO: evaluate these and fix where needed: G307: Deferring unsafe method "*os.File" on type "Close" (gosec)
    70      - text: "(G104|G307)"
    71        linters:
    72          - gosec
    73      # EXC0009
    74      - text: "(Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less)"
    75        linters:
    76          - gosec
    77      # EXC0010
    78      - text: "Potential file inclusion via variable"
    79        linters:
    80          - gosec
    81  
    82      # Looks like the match in "EXC0007" above doesn't catch this one
    83      # TODO: consider upstreaming this to golangci-lint's default exclusion rules
    84      - text: "G204: Subprocess launched with a potential tainted input or cmd arguments"
    85        linters:
    86          - gosec
    87      # Looks like the match in "EXC0009" above doesn't catch this one
    88      # TODO: consider upstreaming this to golangci-lint's default exclusion rules
    89      - text: "G306: Expect WriteFile permissions to be 0600 or less"
    90        linters:
    91          - gosec
    92  
    93      # Exclude some linters from running on tests files.
    94      - path: _test\.go
    95        linters:
    96          - errcheck
    97          - gosec
    98  
    99      # Suppress golint complaining about generated types in api/types/
   100      - text: "type name will be used as (container|volume)\\.(Container|Volume).* by other packages, and that stutters; consider calling this"
   101        path: "api/types/(volume|container)/"
   102        linters:
   103          - revive
   104      # FIXME temporarily suppress these. See #39924
   105      - text: "SA1019: .*\\.Xattrs has been deprecated since Go 1.10: Use PAXRecords instead"
   106        linters:
   107          - staticcheck
   108      # FIXME temporarily suppress these. See #39926
   109      - text: "SA1019: httputil.NewClientConn"
   110        linters:
   111          - staticcheck
   112      # FIXME temporarily suppress these (related to the ones above)
   113      - text: "SA1019: httputil.ErrPersistEOF"
   114        linters:
   115          - staticcheck
   116  
   117    # Maximum issues count per one linter. Set to 0 to disable. Default is 50.
   118    max-issues-per-linter: 0
   119  
   120    # Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
   121    max-same-issues: 0