Skip to content

Commit 6a260ef

Browse files
author
Ivan Korjavin
committed
Merge tag 'v1.23.7'
* tag 'v1.23.7': (140 commits) dev: prepare v1.23.7 autogenerated_exclude: increase scanner max buffer size dev: use go1.14 change increase to increasing in timeout error dev: release v1.23.6 tools: update goreleaser dev: release v1.23.5 Support Go 1.14rc1. Simplify alpine Dockerfile add missing mips option Update to latest x/tools (golangci#930) fix golangci#869 by removing lock file after unlocking (golangci#947) dev: release v1.23.3 autogenerated_exclude: increase scanner buffer (golangci#955) gocritic: update disabled check warning message Add MIPS arch support dev: release v1.23.2 Fix misspelled words. (golangci#952) Add Intuit to README.md (golangci#936) fix golangci.yml reference ...
2 parents 64fa54c + 96964db commit 6a260ef

File tree

389 files changed

+30000
-16230
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

389 files changed

+30000
-16230
lines changed

.github/ISSUE_TEMPLATE.md

+40-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,43 @@
11
Thank you for creating the issue!
22

3+
- [ ] Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
4+
- [ ] Yes, I've searched similar issues on GitHub and didn't find any.
5+
- [ ] Yes, I've included all information below (version, config, etc).
6+
37
Please include the following information:
4-
1. Version of golangci-lint: `golangci-lint --version` (or git commit if you don't use binary distribution)
5-
2. Config file: `cat .golangci.yml`
6-
3. Go environment: `go version && go env`
7-
4. Verbose output of running: `golangci-lint run -v`
8+
9+
<details><summary>Version of golangci-lint</summary>
10+
11+
```console
12+
$ golangci-lint --version
13+
# paste output here
14+
```
15+
16+
</details>
17+
18+
<details><summary>Config file</summary>
19+
20+
```console
21+
$ cat .golangci.yml
22+
# paste output here
23+
```
24+
25+
</details>
26+
27+
<details><summary>Go environment</summary>
28+
29+
```console
30+
$ go version && go env
31+
# paste output here
32+
```
33+
34+
</details>
35+
36+
<details><summary>Verbose output of running</summary>
37+
38+
```console
39+
$ golangci-lint run -v
40+
# paste output here
41+
```
42+
43+
</details>

.github/stale.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Number of days of inactivity before an issue becomes stale
2+
daysUntilStale: 180
3+
4+
# Number of days of inactivity before a stale issue is closed
5+
daysUntilClose: 14
6+
7+
# Issues with these labels will never be considered stale
8+
exemptLabels:
9+
- pinned
10+
- security
11+
12+
# Label to use when marking an issue as stale
13+
staleLabel: stale
14+
15+
# Comment to post when marking an issue as stale. Set to `false` to disable
16+
markComment: >
17+
This issue has been automatically marked as stale because it has not had
18+
recent activity. It will be closed if no further activity occurs. Thank you
19+
for your contributions.
20+
21+
# Comment to post when closing a stale issue. Set to `false` to disable
22+
closeComment: false

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22
/*.pdf
33
/*.pprof
44
/dist/
5+
/tools/dist/
56
/.idea/
67
/test/path
78
/golangci-lint
89
/tools/Dracula.itermcolors
10+
/tools/godownloader
11+
/tools/goreleaser
912
/tools/node_modules
1013
/tools/svg-term
1114
/.vscode/

.golangci.example.yml

+127-86
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ run:
77
concurrency: 4
88

99
# timeout for analysis, e.g. 30s, 5m, default is 1m
10-
deadline: 1m
10+
timeout: 1m
1111

1212
# exit code when at least one issue was found, default is 1
1313
issues-exit-code: 1
@@ -19,15 +19,18 @@ run:
1919
build-tags:
2020
- mytag
2121

22-
# which dirs to skip: they won't be analyzed;
22+
# which dirs to skip: issues from them won't be reported;
2323
# can use regexp here: generated.*, regexp is applied on full path;
24-
# default value is empty list, but next dirs are always skipped independently
25-
# from this option's value:
26-
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
24+
# default value is empty list, but default dirs are skipped independently
25+
# from this option's value (see skip-dirs-use-default).
2726
skip-dirs:
2827
- src/external_libs
2928
- autogenerated_by_my_lib
3029

30+
# default is true. Enables skipping of directories:
31+
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
32+
skip-dirs-use-default: true
33+
3134
# which files to skip: they will be analyzed, but issues from them
3235
# won't be reported. Default value is empty list, but there is
3336
# no need to include all autogenerated files, we confidently recognize
@@ -58,11 +61,20 @@ output:
5861
# print linter name in the end of issue text, default is true
5962
print-linter-name: true
6063

64+
# make issues output unique by line, default is true
65+
uniq-by-line: true
66+
6167

6268
# all available settings of specific linters
6369
linters-settings:
70+
dogsled:
71+
# checks assignments with too many blank identifiers; default is 2
72+
max-blank-identifiers: 2
73+
dupl:
74+
# tokens count to trigger issue, 150 by default
75+
threshold: 100
6476
errcheck:
65-
# report about not checking of errors in type assetions: `a := b.(MyStruct)`;
77+
# report about not checking of errors in type assertions: `a := b.(MyStruct)`;
6678
# default is false: such cases aren't reported by default.
6779
check-type-assertions: false
6880

@@ -78,11 +90,64 @@ linters-settings:
7890
# path to a file containing a list of functions to exclude from checking
7991
# see https://github.com/kisielk/errcheck#excluding-functions for details
8092
exclude: /path/to/file.txt
81-
8293
funlen:
8394
lines: 60
8495
statements: 40
96+
gocognit:
97+
# minimal code complexity to report, 30 by default (but we recommend 10-20)
98+
min-complexity: 10
99+
goconst:
100+
# minimal length of string constant, 3 by default
101+
min-len: 3
102+
# minimal occurrences count to trigger, 3 by default
103+
min-occurrences: 3
104+
gocritic:
105+
# Which checks should be enabled; can't be combined with 'disabled-checks';
106+
# See https://go-critic.github.io/overview#checks-overview
107+
# To check which checks are enabled run `GL_DEBUG=gocritic golangci-lint run`
108+
# By default list of stable checks is used.
109+
enabled-checks:
110+
- rangeValCopy
111+
112+
# Which checks should be disabled; can't be combined with 'enabled-checks'; default is empty
113+
disabled-checks:
114+
- regexpMust
85115

116+
# Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint run` to see all tags and checks.
117+
# Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags".
118+
enabled-tags:
119+
- performance
120+
121+
settings: # settings passed to gocritic
122+
captLocal: # must be valid enabled check name
123+
paramsOnly: true
124+
rangeValCopy:
125+
sizeThreshold: 32
126+
gocyclo:
127+
# minimal code complexity to report, 30 by default (but we recommend 10-20)
128+
min-complexity: 10
129+
godox:
130+
# report any comments starting with keywords, this is useful for TODO or FIXME comments that
131+
# might be left in the code accidentally and should be resolved before merging
132+
keywords: # default keywords are TODO, BUG, and FIXME, these can be overwritten by this setting
133+
- NOTE
134+
- OPTIMIZE # marks code that should be optimized before merging
135+
- HACK # marks hack-arounds that should be removed before merging
136+
gofmt:
137+
# simplify code: gofmt with `-s` option, true by default
138+
simplify: true
139+
goimports:
140+
# put imports beginning with prefix after 3rd-party packages;
141+
# it's a comma-separated list of prefixes
142+
local-prefixes: github.com/org/project
143+
golint:
144+
# minimal confidence for issues, default is 0.8
145+
min-confidence: 0.8
146+
gomnd:
147+
settings:
148+
mnd:
149+
# the list of enabled checks, see https://github.com/tommy-muehle/go-mnd/#checks for description.
150+
checks: argument,case,condition,operation,return,assign
86151
govet:
87152
# report about shadowed variables
88153
check-shadowing: true
@@ -103,63 +168,30 @@ linters-settings:
103168
disable:
104169
- shadow
105170
disable-all: false
106-
golint:
107-
# minimal confidence for issues, default is 0.8
108-
min-confidence: 0.8
109-
gofmt:
110-
# simplify code: gofmt with `-s` option, true by default
111-
simplify: true
112-
goimports:
113-
# put imports beginning with prefix after 3rd-party packages;
114-
# it's a comma-separated list of prefixes
115-
local-prefixes: github.com/org/project
116-
gocyclo:
117-
# minimal code complexity to report, 30 by default (but we recommend 10-20)
118-
min-complexity: 10
119-
maligned:
120-
# print struct with more effective memory layout or not, false by default
121-
suggest-new: true
122-
dupl:
123-
# tokens count to trigger issue, 150 by default
124-
threshold: 100
125-
goconst:
126-
# minimal length of string constant, 3 by default
127-
min-len: 3
128-
# minimal occurrences count to trigger, 3 by default
129-
min-occurrences: 3
130171
depguard:
131172
list-type: blacklist
132173
include-go-root: false
133174
packages:
134175
- github.com/sirupsen/logrus
135-
packages-with-error-messages:
176+
packages-with-error-message:
136177
# specify an error message to output when a blacklisted package is used
137-
github.com/sirupsen/logrus: "logging is allowed only by logutils.Log"
178+
- github.com/sirupsen/logrus: "logging is allowed only by logutils.Log"
179+
lll:
180+
# max line length, lines longer will be reported. Default is 120.
181+
# '\t' is counted as 1 character by default, and can be changed with the tab-width option
182+
line-length: 120
183+
# tab width in spaces. Default to 1.
184+
tab-width: 1
185+
maligned:
186+
# print struct with more effective memory layout or not, false by default
187+
suggest-new: true
138188
misspell:
139189
# Correct spellings using locale preferences for US or UK.
140190
# Default is to use a neutral variety of English.
141191
# Setting locale to US will correct the British spelling of 'colour' to 'color'.
142192
locale: US
143193
ignore-words:
144194
- someword
145-
lll:
146-
# max line length, lines longer will be reported. Default is 120.
147-
# '\t' is counted as 1 character by default, and can be changed with the tab-width option
148-
line-length: 120
149-
# tab width in spaces. Default to 1.
150-
tab-width: 1
151-
unused:
152-
# treat code as a program (not a library) and report unused exported identifiers; default is false.
153-
# XXX: if you enable this setting, unused will report a lot of false-positives in text editors:
154-
# if it's called for subdir of a project it can't find funcs usages. All text editor integrations
155-
# with golangci-lint call it on a directory with the changed file.
156-
check-exported: false
157-
unparam:
158-
# Inspect exported functions, default is false. Set to true if no external program/library imports your code.
159-
# XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
160-
# if it's called for subdir of a project it can't find external interfaces. All text editor integrations
161-
# with golangci-lint call it on a directory with the changed file.
162-
check-exported: false
163195
nakedret:
164196
# make an issue if func has more lines of code than this setting and it has naked returns; default is 30
165197
max-func-lines: 30
@@ -172,47 +204,56 @@ linters-settings:
172204
simple: true
173205
range-loops: true # Report preallocation suggestions on range loops, true by default
174206
for-loops: false # Report preallocation suggestions on for loops, false by default
175-
gocritic:
176-
# Which checks should be enabled; can't be combined with 'disabled-checks';
177-
# See https://go-critic.github.io/overview#checks-overview
178-
# To check which checks are enabled run `GL_DEBUG=gocritic golangci-lint run`
179-
# By default list of stable checks is used.
180-
enabled-checks:
181-
- rangeValCopy
182-
183-
# Which checks should be disabled; can't be combined with 'enabled-checks'; default is empty
184-
disabled-checks:
185-
- regexpMust
186-
187-
# Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint` run to see all tags and checks.
188-
# Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags".
189-
enabled-tags:
190-
- performance
191-
192-
settings: # settings passed to gocritic
193-
captLocal: # must be valid enabled check name
194-
paramsOnly: true
195-
rangeValCopy:
196-
sizeThreshold: 32
197-
godox:
198-
# report any comments starting with keywords, this is useful for TODO or FIXME comments that
199-
# might be left in the code accidentally and should be resolved before merging
200-
keywords: # default keywords are TODO, BUG, and FIXME, these can be overwritten by this setting
201-
- NOTE
202-
- OPTIMIZE # marks code that should be optimized before merging
203-
- HACK # marks hack-arounds that should be removed before merging
204-
dogsled:
205-
# checks assignments with too many blank identifiers; default is 2
206-
max-blank-identifiers: 2
207-
207+
rowserrcheck:
208+
packages:
209+
- github.com/jmoiron/sqlx
210+
unparam:
211+
# Inspect exported functions, default is false. Set to true if no external program/library imports your code.
212+
# XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
213+
# if it's called for subdir of a project it can't find external interfaces. All text editor integrations
214+
# with golangci-lint call it on a directory with the changed file.
215+
check-exported: false
216+
unused:
217+
# treat code as a program (not a library) and report unused exported identifiers; default is false.
218+
# XXX: if you enable this setting, unused will report a lot of false-positives in text editors:
219+
# if it's called for subdir of a project it can't find funcs usages. All text editor integrations
220+
# with golangci-lint call it on a directory with the changed file.
221+
check-exported: false
208222
whitespace:
209-
multi-if: false
223+
multi-if: false # Enforces newlines (or comments) after every multi-line if statement
224+
multi-func: false # Enforces newlines (or comments) after every multi-line function signature
225+
wsl:
226+
# If true append is only allowed to be cuddled if appending value is
227+
# matching variables, fields or types on line above. Default is true.
228+
strict-append: true
229+
# Allow calls and assignments to be cuddled as long as the lines have any
230+
# matching variables, fields or types. Default is true.
231+
allow-assign-and-call: true
232+
# Allow multiline assignments to be cuddled. Default is true.
233+
allow-multiline-assign: true
234+
# Allow declarations (var) to be cuddled.
235+
allow-cuddle-declarations: false
236+
# Allow trailing comments in ending of blocks
237+
allow-trailing-comment: false
238+
# Force newlines in end of case at this limit (0 = never).
239+
force-case-trailing-whitespace: 0
240+
241+
# The custom section can be used to define linter plugins to be loaded at runtime. See README doc
242+
# for more info.
243+
custom:
244+
# Each custom linter should have a unique name.
245+
example:
246+
# The path to the plugin *.so. Can be absolute or local. Required for each custom linter
247+
path: /path/to/example.so
248+
# The description of the linter. Optional, just for documentation purposes.
249+
description: This is an example usage of a plugin linter.
250+
# Intended to point to the repo location of the linter. Optional, just for documentation purposes.
251+
original-url: github.com/golangci/example-linter
210252

211253
linters:
212254
enable:
213255
- megacheck
214256
- govet
215-
enable-all: false
216257
disable:
217258
- maligned
218259
- prealloc

0 commit comments

Comments
 (0)