github.com/google/go-github/v68@v68.0.0/.golangci.yml (about)

     1  run:
     2    build-tags:
     3      - integration
     4    timeout: 10m
     5  linters:
     6    enable:
     7      - canonicalheader
     8      - dogsled
     9      - dupl
    10      - gci
    11      - gocritic
    12      - godot
    13      - gofmt
    14      - goimports
    15      - gosec
    16      - misspell
    17      - nakedret
    18      - perfsprint
    19      - paralleltest
    20      - revive
    21      - stylecheck
    22      - tparallel
    23      - unconvert
    24      - unparam
    25      - whitespace
    26  linters-settings:
    27    gocritic:
    28      disable-all: true
    29      enabled-checks:
    30        - commentedOutCode
    31        - commentFormatting
    32    gosec:
    33      excludes:
    34        # duplicates errcheck
    35        - G104
    36        # int(os.Stdin.Fd())
    37        - G115
    38    perfsprint:
    39      errorf: true
    40      strconcat: false
    41    revive:
    42      rules:
    43        - name: blank-imports
    44        - name: bool-literal-in-expr
    45        - name: context-as-argument
    46        - name: context-keys-type
    47        - name: dot-imports
    48        - name: early-return
    49        - name: empty-block
    50        - name: error-naming
    51        - name: error-return
    52        - name: error-strings
    53        - name: errorf
    54        - name: filename-format
    55          arguments:
    56            - "^[_a-z][_a-z0-9]*.go$"
    57        - name: increment-decrement
    58        - name: indent-error-flow
    59        - name: package-comments
    60        - name: range
    61        - name: receiver-naming
    62        - name: redefines-builtin-id
    63        - name: superfluous-else
    64        - name: time-equal
    65        - name: time-naming
    66        - name: unexported-naming
    67        - name: unexported-return
    68        - name: unreachable-code
    69        - name: var-declaration
    70        - name: var-naming
    71  issues:
    72    exclude-use-default: false
    73    exclude-rules:
    74      - linters:
    75          - dupl
    76          - unparam
    77          - gosec
    78          - dogsled
    79        path: _test\.go
    80  
    81      # We need to pass nil Context in order to test DoBare erroring on nil ctx.
    82      - linters: [ staticcheck ]
    83        text: 'SA1012: do not pass a nil Context'
    84        path: _test\.go
    85  
    86      # We need to use sha1 for validating signatures
    87      - linters: [ gosec ]
    88        text: 'G505: Blocklisted import crypto/sha1: weak cryptographic primitive'
    89  
    90      # This is adapted from golangci-lint's default exclusions. It disables linting for error checks on
    91      # os.RemoveAll, fmt.Fprint*, fmt.Scanf, and any function ending in "Close".
    92      - linters: [ errcheck ]
    93        text: Error return value of .(.*Close|fmt\.Fprint.*|fmt\.Scanf|os\.Remove(All)?). is not checked
    94  
    95      # We don't care about file inclusion via variable in examples or internal tools.
    96      - linters: [ gosec ]
    97        text: 'G304: Potential file inclusion via variable'
    98        path: '^(example|tools)\/'
    99  
   100      # We don't run parallel integration tests
   101      - linters: [ paralleltest, tparallel ]
   102        path: '^test/integration'
   103  
   104      # Because fmt.Sprint(reset.Unix())) is more readable than strconv.FormatInt(reset.Unix(), 10).
   105      - linters: [ perfsprint]
   106        text: 'fmt.Sprint.* can be replaced with faster strconv.FormatInt'