|
| 1 | +version: "2" |
1 | 2 | run: |
2 | 3 | build-tags: |
3 | 4 | - integration |
4 | | - timeout: 10m |
5 | 5 | linters: |
6 | 6 | enable: |
7 | 7 | - canonicalheader |
8 | 8 | - copyloopvar |
9 | 9 | - dogsled |
10 | 10 | - dupl |
11 | | - - gci |
12 | 11 | - gocritic |
13 | 12 | - godot |
14 | | - - gofmt |
15 | 13 | - goheader |
16 | | - - goimports |
17 | 14 | - gosec |
18 | 15 | - misspell |
19 | 16 | - nakedret |
20 | 17 | - paralleltest |
21 | 18 | - perfsprint |
22 | 19 | - revive |
23 | 20 | - sliceofpointers |
24 | | - - stylecheck |
| 21 | + - staticcheck |
25 | 22 | - tparallel |
26 | 23 | - unconvert |
27 | 24 | - unparam |
28 | 25 | - 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. |
| 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. |
46 | 38 |
|
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 |
| 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: unreachable-code |
| 101 | + - name: use-any |
| 102 | + - name: var-declaration |
| 103 | + - name: var-naming |
| 104 | + staticcheck: |
| 105 | + checks: |
| 106 | + - "all" |
| 107 | + - "-QF1008" # allow embedded field in selector |
| 108 | + custom: |
| 109 | + sliceofpointers: |
| 110 | + type: module |
| 111 | + description: Reports usage of []*string and slices of structs without pointers. |
| 112 | + original-url: github.com/google/go-github/v68/tools/sliceofpointers |
| 113 | + exclusions: |
82 | 114 | 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: use-any |
110 | | - - name: var-declaration |
111 | | - - name: var-naming |
112 | | -issues: |
113 | | - exclude-use-default: false |
114 | | - exclude-rules: |
115 | | - - linters: |
116 | | - - dupl |
117 | | - - unparam |
118 | | - - gosec |
119 | | - - dogsled |
120 | | - path: _test\.go |
| 115 | + - linters: |
| 116 | + - dogsled |
| 117 | + - dupl |
| 118 | + - gosec |
| 119 | + - unparam |
| 120 | + path: _test\.go |
121 | 121 |
|
122 | | - # We need to pass nil Context in order to test DoBare erroring on nil ctx. |
123 | | - - linters: [staticcheck] |
124 | | - text: "SA1012: do not pass a nil Context" |
125 | | - path: _test\.go |
| 122 | + # We need to pass nil Context in order to test DoBare erroring on nil ctx. |
| 123 | + - linters: [staticcheck] |
| 124 | + path: _test\.go |
| 125 | + text: 'SA1012: do not pass a nil Context' |
126 | 126 |
|
127 | | - # We need to use sha1 for validating signatures |
128 | | - - linters: [gosec] |
129 | | - text: "G505: Blocklisted import crypto/sha1: weak cryptographic primitive" |
| 127 | + # We need to use sha1 for validating signatures |
| 128 | + - linters: [gosec] |
| 129 | + text: 'G505: Blocklisted import crypto/sha1: weak cryptographic primitive' |
130 | 130 |
|
131 | | - # This is adapted from golangci-lint's default exclusions. It disables linting for error checks on |
132 | | - # os.RemoveAll, fmt.Fprint*, fmt.Scanf, and any function ending in "Close". |
133 | | - - linters: [errcheck] |
134 | | - text: Error return value of .(.*Close|fmt\.Fprint.*|fmt\.Scanf|os\.Remove(All)?). is not checked |
| 131 | + # This is adapted from golangci-lint's default exclusions. It disables linting for error checks on |
| 132 | + # os.RemoveAll, fmt.Fprint*, fmt.Scanf, and any function ending in "Close". |
| 133 | + - linters: [errcheck] |
| 134 | + text: Error return value of .(.*Close|fmt\.Fprint.*|fmt\.Scanf|os\.Remove(All)?). is not checked |
135 | 135 |
|
136 | | - # We don't care about file inclusion via variable in examples or internal tools. |
137 | | - - linters: [gosec] |
138 | | - text: "G304: Potential file inclusion via variable" |
139 | | - path: '^(example|tools)\/' |
| 136 | + # We don't care about file inclusion via variable in examples or internal tools. |
| 137 | + - linters: [gosec] |
| 138 | + path: ^(example|tools)\/ |
| 139 | + text: 'G304: Potential file inclusion via variable' |
140 | 140 |
|
141 | | - # We don't run parallel integration tests |
142 | | - - linters: [paralleltest, tparallel] |
143 | | - path: "^test/integration" |
| 141 | + # We don't run parallel integration tests |
| 142 | + - linters: [paralleltest, tparallel] |
| 143 | + path: ^test/integration |
144 | 144 |
|
145 | | - # Because fmt.Sprint(reset.Unix())) is more readable than strconv.FormatInt(reset.Unix(), 10). |
146 | | - - linters: [perfsprint] |
147 | | - text: "fmt.Sprint.* can be replaced with faster strconv.FormatInt" |
| 145 | + # Because fmt.Sprint(reset.Unix())) is more readable than strconv.FormatInt(reset.Unix(), 10). |
| 146 | + - linters: [perfsprint] |
| 147 | + text: fmt.Sprint.* can be replaced with faster strconv.FormatInt |
| 148 | +formatters: |
| 149 | + enable: |
| 150 | + - gci |
| 151 | + - gofmt |
| 152 | + - goimports |
0 commit comments