github.com/jfrazelle/docker@v1.1.2-0.20210712172922-bf78e25fe508/hack/validate/golangci-lint.yml (about)

     1  linters:
     2    enable:
     3      - deadcode
     4      - goimports
     5      - golint
     6      - gosec
     7      - gosimple
     8      - govet
     9      - ineffassign
    10      - misspell
    11      - staticcheck
    12      - structcheck
    13      - typecheck
    14      - unconvert
    15      - unused
    16      - varcheck
    17  
    18    disable:
    19      - errcheck
    20  
    21    run:
    22      concurrency: 2
    23      modules-download-mode: vendor
    24  
    25      skip-dirs:
    26        - bundles
    27        - docs
    28        # TODO: This package should be completely removed
    29        - libnetwork/client/mflag
    30  
    31  linters-settings:
    32    govet:
    33      check-shadowing: false
    34  
    35  issues:
    36    # The default exclusion rules are a bit too permissive, so copying the relevant ones below
    37    exclude-use-default: false
    38  
    39    exclude-rules:
    40      # These are copied from the default exclude rules, except for "ineffective break statement"
    41      # and GoDoc checks.
    42      # https://github.com/golangci/golangci-lint/blob/0cc87df732aaf1d5ad9ce9ca538d38d916918b36/pkg/config/config.go#L36
    43      - text: "Error return value of .((os\\.)?std(out|err)\\..*|.*Close|.*Flush|os\\.Remove(All)?|.*printf?|os\\.(Un)?Setenv). is not checked"
    44        linters:
    45          - errcheck
    46      - text: "func name will be used as test\\.Test.* by other packages, and that stutters; consider calling this"
    47        linters:
    48          - golint
    49      - text: "G103: Use of unsafe calls should be audited"
    50        linters:
    51          - gosec
    52      - text: "G104: Errors unhandled"
    53        linters:
    54          - gosec
    55      - text: "G204: Subprocess launch(ed with (variable|function call)|ing should be audited)"
    56        linters:
    57          - gosec
    58      - text: "(G301|G302): (Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less)"
    59        linters:
    60          - gosec
    61      - text: "G304: Potential file inclusion via variable"
    62        linters:
    63          - gosec
    64      - text: "G306: Expect WriteFile permissions to be 0600 or less"
    65        linters:
    66          - gosec
    67      - text: 'G307: Deferring unsafe method "Close" on type "*os.File"'
    68        linters: gosec
    69  
    70      # Exclude some linters from running on tests files.
    71      - path: _test\.go
    72        linters:
    73          - errcheck
    74          - gosec
    75  
    76      # Suppress golint complaining about generated types in api/types/
    77      - text: "type name will be used as (container|volume)\\.(Container|Volume).* by other packages, and that stutters; consider calling this"
    78        path: "api/types/(volume|container)/"
    79        linters:
    80          - golint
    81      - text: "(G201|G202): SQL string (formatting|concatenation)"
    82        linters:
    83          - gosec
    84      # FIXME: evaluate these and fix where needed: G307: Deferring unsafe method "*os.File" on type "Close" (gosec)
    85      - text: "G307: Deferring unsafe method"
    86        linters:
    87          - gosec
    88      # FIXME temporarily suppress these. See #39924
    89      - text: "SA1019: .*\\.Xattrs is deprecated: Use PAXRecords instead"
    90        linters:
    91          - staticcheck
    92      # FIXME temporarily suppress these. See #39926
    93      - text: "SA1019: httputil.NewClientConn"
    94        linters:
    95          - staticcheck
    96      # FIXME temporarily suppress these (related to the ones above)
    97      - text: "SA1019: httputil.ErrPersistEOF"
    98        linters:
    99          - staticcheck
   100      # FIXME temporarily suppress these for false positives in tests (see https://github.com/dominikh/go-tools/issues/1022)
   101      - text: "SA5011"
   102        path: _test\.go
   103        linters:
   104          - staticcheck
   105      # This code is doing some fun stuff with reflect and it trips up the linter.
   106      - text: "field `foo` is unused"
   107        path: "libnetwork/options/options_test.go"
   108        linters:
   109          - structcheck
   110          - unused
   111      # This field is only used on windows but is defined in a platform agnostic file.
   112      # The linter doesn't understand that the field is used.
   113      - text: "`resolverOnce` is unused"
   114        path: libnetwork/network.go
   115        linters:
   116          - structcheck
   117          - unused
   118  
   119    # Maximum issues count per one linter. Set to 0 to disable. Default is 50.
   120    max-issues-per-linter: 0
   121  
   122    # Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
   123    max-same-issues: 0