github.com/openshift/installer@v1.4.17/.golangci.yaml (about)

     1  run:
     2    timeout: 20m
     3    skip-dirs:
     4    - ^bin
     5    - ^cluster-api
     6    - ^data/data
     7    - ^docs
     8    - ^hack
     9    - ^images
    10    - ^scripts
    11    - ^terraform
    12    - ^upi
    13    go: '1.22'
    14    modules-download-mode: vendor
    15    allow-parallel-runners: true
    16  output:
    17    print-linter-name: true
    18    sort-results: true
    19    uniq-by-line: false
    20  linters:
    21    enable:
    22    - asciicheck
    23    - containedctx
    24    - decorder
    25    - dogsled
    26    - errcheck
    27    - errorlint
    28    - exportloopref
    29    - goconst
    30    - gocritic
    31    - gocyclo
    32    - godot
    33    - gofmt
    34    - goimports
    35    - gosec
    36    - gosimple
    37    - govet
    38    - importas
    39    - ineffassign
    40    - misspell
    41    - nakedret
    42    - prealloc
    43    - predeclared
    44    - revive
    45    - staticcheck
    46    - stylecheck
    47    - tenv
    48    - thelper
    49    - typecheck
    50    - unconvert
    51    - unused
    52    - whitespace
    53  linters-settings:
    54    errcheck:
    55      # Report about not checking of errors in type assertions: `a := b.(MyStruct)`.
    56      # Such cases aren't reported by default.
    57      # Default: false
    58      check-type-assertions: true
    59      # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`.
    60      # Such cases aren't reported by default.
    61      # Default: false
    62      check-blank: true
    63      # DEPRECATED comma-separated list of pairs of the form pkg:regex
    64      #
    65      # the regex is used to ignore names within pkg. (default "fmt:.*").
    66      # see https://github.com/kisielk/errcheck#the-deprecated-method for details
    67      ignore: fmt:.*,io/ioutil:^Read.*
    68      # To disable the errcheck built-in exclude list.
    69      # See `-excludeonly` option in https://github.com/kisielk/errcheck#excluding-functions for details.
    70      # Default: false
    71      disable-default-exclusions: true
    72      # DEPRECATED use exclude-functions instead.
    73      #
    74      # Path to a file containing a list of functions to exclude from checking.
    75      # See https://github.com/kisielk/errcheck#excluding-functions for details.
    76      # exclude: /path/to/file.txt
    77      # List of functions to exclude from checking, where each entry is a single function to exclude.
    78      # See https://github.com/kisielk/errcheck#excluding-functions for details.
    79      exclude-functions:
    80      - io/ioutil.ReadFile
    81      - io.Copy(*bytes.Buffer)
    82      - io.Copy(os.Stdout)
    83    errorlint:
    84      # Check whether fmt.Errorf uses the %w verb for formatting errors.
    85      # See the https://github.com/polyfloyd/go-errorlint for caveats.
    86      # Default: true
    87      errorf: true
    88      # Check for plain type assertions and type switches.
    89      # Default: true
    90      asserts: true
    91      # Check for plain error comparisons.
    92      # Default: true
    93      comparison: true
    94    gci:
    95      # DEPRECATED: use `sections` and `prefix(github.com/org/project)` instead.
    96      # local-prefixes: github.com/org/project
    97      #
    98      # Section configuration to compare against.
    99      # Section names are case-insensitive and may contain parameters in ().
   100      # The default order of sections is `standard > default > custom > blank > dot`,
   101      # If `custom-order` is `true`, it follows the order of `sections` option.
   102      # Default: ["standard", "default"]
   103      sections:
   104      - standard # Standard section: captures all standard packages.
   105      - default # Default section: contains all imports that could not be matched to another section type.
   106      - prefix(github.com/openshift) # Custom section: groups all imports with the specified Prefix.
   107      - blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
   108      # - dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled.
   109      # Skip generated files.
   110      # Default: true
   111      skip-generated: true
   112      # Enable custom order of sections.
   113      # If `true`, make the section order the same as the order of `sections`.
   114      # Default: false
   115      custom-order: true
   116    gofumpt:
   117      # Select the Go version to target.
   118      # Default: "1.15"
   119      # Deprecated: use the global `run.go` instead.
   120      # lang-version: "1.17"
   121      # Module path which contains the source code being formatted.
   122      # Default: ""
   123      module-path: github.com/openshift/installer
   124      # Choose whether to use the extra rules.
   125      # Default: false
   126      extra-rules: true
   127    goimports:
   128      # Put imports beginning with prefix after 3rd-party packages.
   129      # It's a comma-separated list of prefixes.
   130      # Default: ""
   131      local-prefixes: github.com/openshift
   132    revive:
   133      rules:
   134      # The following rules are recommended https://github.com/mgechev/revive#recommended-configuration
   135      - name: blank-imports
   136      - name: context-as-argument
   137      - name: context-keys-type
   138      - name: dot-imports
   139      - name: error-return
   140      - name: error-strings
   141      - name: error-naming
   142      - name: exported
   143      - name: if-return
   144      - name: increment-decrement
   145      - name: var-naming
   146      - name: var-declaration
   147      - name: range
   148      - name: receiver-naming
   149      - name: time-naming
   150      - name: unexported-return
   151      - name: indent-error-flow
   152      - name: errorf
   153      - name: superfluous-else
   154      - name: unreachable-code
   155      - name: redefines-builtin-id
   156      - name: bool-literal-in-expr
   157      - name: constant-logical-expr
   158  issues:
   159    include:
   160    - EXC0012 # EXC0012 revive: issue about not having a comment on exported.
   161    - EXC0014 # EXC0014 revive: issue about not having a comment in the right format.
   162    exclude-rules:
   163    - linters:
   164      - goconst
   165      path: _test\.go