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

     1  run:
     2    build-tags:
     3      - integration
     4    timeout: 10m
     5  linters:
     6    enable:
     7      - canonicalheader
     8      - copyloopvar
     9      - dogsled
    10      - dupl
    11      - gci
    12      - gocritic
    13      - godot
    14      - gofmt
    15      - goheader
    16      - goimports
    17      - gosec
    18      - misspell
    19      - nakedret
    20      - paralleltest
    21      - perfsprint
    22      - revive
    23      - sliceofpointers
    24      - stylecheck
    25      - tparallel
    26      - unconvert
    27      - unparam
    28      - whitespace
    29  linters-settings:
    30    custom:
    31      sliceofpointers:
    32        type: module
    33        description: Reports usage of []*string and slices of structs without pointers.
    34        original-url: github.com/google/go-github/v68/tools/sliceofpointers
    35    gocritic:
    36      disable-all: true
    37      enabled-checks:
    38        - commentedOutCode
    39        - commentFormatting
    40    goheader:
    41      values:
    42        regexp:
    43          CopyrightDate: "Copyright \\d{4} "
    44      template: |-
    45        {{CopyrightDate}}The go-github AUTHORS. All rights reserved.
    46  
    47        Use of this source code is governed by a BSD-style
    48        license that can be found in the LICENSE file.
    49    gosec:
    50      excludes:
    51        # duplicates errcheck
    52        - G104
    53        # int(os.Stdin.Fd())
    54        - G115
    55    misspell:
    56      locale: US
    57      ignore-words:
    58        - "analyses" # returned by the GitHub API
    59        - "cancelled" # returned by the GitHub API
    60      # extra words from https://go.dev//wiki/Spelling
    61      extra-words:
    62        - typo: "marshall"
    63          correction: "marshal"
    64        - typo: "marshalled"
    65          correction: "marshaled"
    66        - typo: "marshalling"
    67          correction: "marshaling"
    68        - typo: "unmarshall"
    69          correction: "unmarshal"
    70        - typo: "unmarshalling"
    71          correction: "unmarshaling"
    72        - typo: "unmarshalled"
    73          correction: "unmarshaled"
    74        - typo: "unmarshalling"
    75          correction: "unmarshaling"
    76    perfsprint:
    77      errorf: true
    78      strconcat: false
    79    revive:
    80      # Set below 0.8 to enable error-strings rule.
    81      confidence: 0.6
    82      rules:
    83        - name: blank-imports
    84        - name: bool-literal-in-expr
    85        - name: context-as-argument
    86        - name: context-keys-type
    87        - name: dot-imports
    88        - name: early-return
    89        - name: empty-block
    90        - name: error-naming
    91        - name: error-return
    92        - name: error-strings
    93        - name: errorf
    94        - name: filename-format
    95          arguments:
    96            - "^[_a-z][_a-z0-9]*.go$"
    97        - name: increment-decrement
    98        - name: indent-error-flow
    99        - name: package-comments
   100        - name: range
   101        - name: receiver-naming
   102        - name: redefines-builtin-id
   103        - name: superfluous-else
   104        - name: time-equal
   105        - name: time-naming
   106        - name: unexported-naming
   107        - name: unexported-return
   108        - name: unreachable-code
   109        - name: var-declaration
   110        - name: var-naming
   111  issues:
   112    exclude-use-default: false
   113    exclude-rules:
   114      - linters:
   115          - dupl
   116          - unparam
   117          - gosec
   118          - dogsled
   119        path: _test\.go
   120  
   121      # We need to pass nil Context in order to test DoBare erroring on nil ctx.
   122      - linters: [staticcheck]
   123        text: "SA1012: do not pass a nil Context"
   124        path: _test\.go
   125  
   126      # We need to use sha1 for validating signatures
   127      - linters: [gosec]
   128        text: "G505: Blocklisted import crypto/sha1: weak cryptographic primitive"
   129  
   130      # This is adapted from golangci-lint's default exclusions. It disables linting for error checks on
   131      # os.RemoveAll, fmt.Fprint*, fmt.Scanf, and any function ending in "Close".
   132      - linters: [errcheck]
   133        text: Error return value of .(.*Close|fmt\.Fprint.*|fmt\.Scanf|os\.Remove(All)?). is not checked
   134  
   135      # We don't care about file inclusion via variable in examples or internal tools.
   136      - linters: [gosec]
   137        text: "G304: Potential file inclusion via variable"
   138        path: '^(example|tools)\/'
   139  
   140      # We don't run parallel integration tests
   141      - linters: [paralleltest, tparallel]
   142        path: "^test/integration"
   143  
   144      # Because fmt.Sprint(reset.Unix())) is more readable than strconv.FormatInt(reset.Unix(), 10).
   145      - linters: [perfsprint]
   146        text: "fmt.Sprint.* can be replaced with faster strconv.FormatInt"