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

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