Skip to content

Commit a8e7ec4

Browse files
docs: update documentation assets (#5393)
Co-authored-by: Fernandez Ludovic <[email protected]>
1 parent efc8ac2 commit a8e7ec4

File tree

5 files changed

+4311
-40
lines changed

5 files changed

+4311
-40
lines changed

.golangci.reference.yml

+58-14
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@ linters:
3131
- errchkjson
3232
- errname
3333
- errorlint
34-
- execinquery
3534
- exhaustive
3635
- exhaustruct
37-
- exportloopref
3836
- exptostd
3937
- fatcontext
4038
- forbidigo
@@ -106,7 +104,6 @@ linters:
106104
- stylecheck
107105
- tagalign
108106
- tagliatelle
109-
- tenv
110107
- testableexamples
111108
- testifylint
112109
- testpackage
@@ -150,10 +147,8 @@ linters:
150147
- errchkjson
151148
- errname
152149
- errorlint
153-
- execinquery
154150
- exhaustive
155151
- exhaustruct
156-
- exportloopref
157152
- exptostd
158153
- fatcontext
159154
- forbidigo
@@ -225,7 +220,6 @@ linters:
225220
- stylecheck
226221
- tagalign
227222
- tagliatelle
228-
- tenv
229223
- testableexamples
230224
- testifylint
231225
- testpackage
@@ -243,15 +237,18 @@ linters:
243237
- wsl
244238
- zerologlint
245239
- deadcode # Deprecated
240+
- execinquery # Deprecated
246241
- exhaustivestruct # Deprecated
242+
- exportloopref # Deprecated
247243
- golint # Deprecated
244+
- gomnd # Deprecated
248245
- ifshort # Deprecated
249246
- interfacer # Deprecated
250247
- maligned # Deprecated
251-
- gomnd # Deprecated
252248
- nosnakecase # Deprecated
253249
- scopelint # Deprecated
254250
- structcheck # Deprecated
251+
- tenv # Deprecated
255252
- varcheck # Deprecated
256253

257254
# Enable presets.
@@ -548,6 +545,12 @@ linters-settings:
548545
exclude:
549546
- '.+/cobra\.Command$'
550547

548+
fatcontext:
549+
# Check for potential fat contexts in struct pointers.
550+
# May generate false positives.
551+
# Default: false
552+
check-struct-pointers: true
553+
551554
forbidigo:
552555
# Forbid the following identifiers (list of regexp).
553556
# Default: ["^(fmt\\.Print(|f|ln)|print|println)$"]
@@ -1841,7 +1844,7 @@ linters-settings:
18411844
- sortslice
18421845
# Check signature of methods of well-known interfaces.
18431846
- stdmethods
1844-
# Check for uses of too-new standard library symbols.
1847+
# Report uses of too-new standard library symbols.
18451848
- stdversion
18461849
# Check for string(int) conversions.
18471850
- stringintconv
@@ -1863,7 +1866,7 @@ linters-settings:
18631866
- unusedresult
18641867
# Checks for unused writes.
18651868
- unusedwrite
1866-
# Checks for misuses of sync.WaitGroup.
1869+
# Check for misuses of sync.WaitGroup.
18671870
- waitgroup
18681871

18691872
# Enable all analyzers.
@@ -1908,6 +1911,7 @@ linters-settings:
19081911
- slog
19091912
- sortslice
19101913
- stdmethods
1914+
- stdversion
19111915
- stringintconv
19121916
- structtag
19131917
- testinggoroutine
@@ -1918,6 +1922,7 @@ linters-settings:
19181922
- unsafeptr
19191923
- unusedresult
19201924
- unusedwrite
1925+
- waitgroup
19211926

19221927
# Settings per analyzer.
19231928
settings:
@@ -2238,23 +2243,37 @@ linters-settings:
22382243
# still required to have `t.Parallel`, but subtests are allowed to skip it.
22392244
# Default: false
22402245
ignore-missing-subtests: true
2241-
22422246
perfsprint:
2247+
# Enable/disable optimization of integer formatting.
2248+
# Default: true
2249+
integer-format: false
22432250
# Optimizes even if it requires an int or uint type cast.
22442251
# Default: true
22452252
int-conversion: false
2253+
# Enable/disable optimization of error formatting.
2254+
# Default: true
2255+
error-format: false
22462256
# Optimizes into `err.Error()` even if it is only equivalent for non-nil errors.
22472257
# Default: false
22482258
err-error: true
22492259
# Optimizes `fmt.Errorf`.
22502260
# Default: true
22512261
errorf: false
2262+
# Enable/disable optimization of string formatting.
2263+
# Default: true
2264+
string-format: false
22522265
# Optimizes `fmt.Sprintf` with only one argument.
22532266
# Default: true
22542267
sprintf1: false
22552268
# Optimizes into strings concatenation.
22562269
# Default: true
22572270
strconcat: false
2271+
# Enable/disable optimization of bool formatting.
2272+
# Default: true
2273+
bool-format: false
2274+
# Enable/disable optimization of hex formatting.
2275+
# Default: true
2276+
hex-format: false
22582277

22592278
prealloc:
22602279
# IMPORTANT: we don't recommend using this linter before doing performance profiling.
@@ -2371,7 +2390,7 @@ linters-settings:
23712390
# This means that linting errors with less than 0.8 confidence will be ignored.
23722391
# Default: 0.8
23732392
confidence: 0.1
2374-
2393+
# Run `GL_DEBUG=revive golangci-lint run --enable-only=revive` to see default, all available rules, and enabled rules.
23752394
rules:
23762395
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#add-constant
23772396
- name: add-constant
@@ -2508,6 +2527,7 @@ linters-settings:
25082527
exclude: [""]
25092528
arguments:
25102529
- "preserveScope"
2530+
- "allowJump"
25112531
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#empty-block
25122532
- name: empty-block
25132533
severity: warning
@@ -2591,7 +2611,7 @@ linters-settings:
25912611
disabled: false
25922612
exclude: [""]
25932613
arguments:
2594-
- "^[_a-z][_a-z0-9]*.go$"
2614+
- "^[_a-z][_a-z0-9]*\\.go$"
25952615
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#flag-parameter
25962616
- name: flag-parameter
25972617
severity: warning
@@ -2726,6 +2746,11 @@ linters-settings:
27262746
severity: warning
27272747
disabled: false
27282748
exclude: [""]
2749+
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#redundant-build-tag
2750+
- name: redundant-build-tag
2751+
severity: warning
2752+
disabled: false
2753+
exclude: [""]
27292754
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#redundant-import-alias
27302755
- name: redundant-import-alias
27312756
severity: warning
@@ -2835,6 +2860,11 @@ linters-settings:
28352860
severity: warning
28362861
disabled: false
28372862
exclude: [""]
2863+
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#use-errors-new
2864+
- name: use-errors-new
2865+
severity: warning
2866+
disabled: false
2867+
exclude: [""]
28382868
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#useless-break
28392869
- name: useless-break
28402870
severity: warning
@@ -3639,8 +3669,8 @@ linters-settings:
36393669
os-mkdir-temp: false
36403670

36413671
# Enable/disable `os.Setenv()` detections.
3642-
# Default: false
3643-
os-setenv: true
3672+
# Default: true
3673+
os-setenv: false
36443674

36453675
# Enable/disable `os.TempDir()` detections.
36463676
# Default: false
@@ -4026,6 +4056,10 @@ issues:
40264056
# Default: false
40274057
new: true
40284058

4059+
# Show only new issues created after the best common ancestor (merge-base against HEAD).
4060+
# Default: ""
4061+
new-from-merge-base: main
4062+
40294063
# Show only new issues created after git revision `REV`.
40304064
# Default: ""
40314065
new-from-rev: HEAD
@@ -4124,6 +4158,16 @@ run:
41244158
# Default: 1m
41254159
timeout: 5m
41264160

4161+
# The mode used to evaluate relative paths.
4162+
# It's used by exclusions, Go plugins, and some linters.
4163+
# The value can be:
4164+
# - `gomod`: the paths will be relative to the directory of the `go.mod` file.
4165+
# - `gitroot`: the paths will be relative to the git root (the parent directory of `.git`).
4166+
# - `cfg`: the paths will be relative to the configuration file.
4167+
# - `wd` (NOT recommended): the paths will be relative to the place where golangci-lint is run.
4168+
# Default: wd
4169+
relative-path-mode: gomod
4170+
41274171
# Exit code when at least one issue was found.
41284172
# Default: 1
41294173
issues-exit-code: 2

CHANGELOG.md

+42
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,48 @@ If you value it, consider supporting us, we appreciate it! ❤️
77
[![Open Collective backers and sponsors](https://img.shields.io/badge/OpenCollective-Donate-blue?logo=opencollective&style=for-the-badge)](https://opencollective.com/golangci-lint)
88
[![GitHub Sponsors](https://img.shields.io/badge/GitHub-Donate-blue?logo=github&style=for-the-badge)](https://github.com/sponsors/golangci)
99

10+
### v1.64.2
11+
12+
This is the last minor release of golangci-lint v1.
13+
The next release will be golangci-lint [v2](https://github.com/golangci/golangci-lint/issues/5300).
14+
15+
1. Enhancements
16+
* 🎉 go1.24 support
17+
* New `issues.new-from-merge-base` option
18+
* New `run.relative-path-mode` option
19+
2. Linters new features
20+
* `copyloopvar`: from 1.1.0 to 1.2.1 (support suggested fixes)
21+
* `exptostd`: from 0.3.1 to 0.4.1 (handles `golang.org/x/exp/constraints.Ordered`)
22+
* `fatcontext`: from 0.5.3 to 0.7.1 (new option: `check-struct-pointers`)
23+
* `perfsprint`: from 0.7.1 to 0.8.1 (new options: `integer-format`, `error-format`, `string-format`, `bool-format`, and `hex-format`)
24+
* `revive`: from 1.5.1 to 1.6.0 (new rules: `redundant-build-tag`, `use-errors-new`. New option `early-return.early-return`)
25+
3. Linters bug fixes
26+
* `go-errorlint`: from 1.7.0 to 1.7.1
27+
* `gochecknoglobals`: from 0.2.1 to 0.2.2
28+
* `godox`: from 006bad1f9d26 to 1.1.0
29+
* `gosec`: from 2.21.4 to 2.22.0
30+
* `iface`: from 1.3.0 to 1.3.1
31+
* `nilnesserr`: from 0.1.1 to 0.1.2
32+
* `protogetter`: from 0.3.8 to 0.3.9
33+
* `sloglint`: from 0.7.2 to 0.9.0
34+
* `spancheck`: fix default `StartSpanMatchersSlice` values
35+
* `staticcheck`: from 0.5.1 to 0.6.0
36+
4. Deprecations
37+
* ⚠️ `tenv` is deprecated and replaced by `usetesing.osenv: true`.
38+
5. Misc.
39+
* Sanitize severities by output format
40+
* Avoid panic with plugin without description
41+
6. Documentation
42+
* Clarify `depguard` configuration
43+
44+
### v1.64.1
45+
46+
Cancelled due to CI failure.
47+
48+
### v1.64.0
49+
50+
Cancelled due to CI failure.
51+
1052
### v1.63.4
1153

1254
1. Linters bug fixes

assets/linters-info.json

+11-22
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,14 @@
8888
},
8989
{
9090
"name": "copyloopvar",
91-
"desc": "copyloopvar is a linter detects places where loop variables are copied",
91+
"desc": "a linter detects places where loop variables are copied",
9292
"loadMode": 8199,
9393
"inPresets": [
9494
"style"
9595
],
9696
"originalURL": "https://github.com/karamaru-alpha/copyloopvar",
9797
"internal": false,
98+
"canAutoFix": true,
9899
"isSlow": false,
99100
"since": "v1.57.0"
100101
},
@@ -262,23 +263,6 @@
262263
"isSlow": true,
263264
"since": "v1.46.0"
264265
},
265-
{
266-
"name": "exportloopref",
267-
"desc": "checks for pointers to enclosing loop variables",
268-
"loadMode": 8767,
269-
"inPresets": [
270-
"bugs"
271-
],
272-
"originalURL": "https://github.com/kyoh86/exportloopref",
273-
"internal": false,
274-
"isSlow": true,
275-
"since": "v1.28.0",
276-
"deprecation": {
277-
"since": "v1.60.2",
278-
"message": "Since Go1.22 (loopvar) this linter is no longer relevant.",
279-
"replacement": "copyloopvar"
280-
}
281-
},
282266
{
283267
"name": "exptostd",
284268
"desc": "Detects functions from golang.org/x/exp/ that can be replaced by std functions.",
@@ -343,7 +327,7 @@
343327
},
344328
{
345329
"name": "gci",
346-
"desc": "Checks if code and import statements are formatted, it makes import statements always deterministic.",
330+
"desc": "Checks if code and import statements are formatted, with additional rules.",
347331
"loadMode": 8199,
348332
"inPresets": [
349333
"format",
@@ -481,7 +465,7 @@
481465
},
482466
{
483467
"name": "godox",
484-
"desc": "Tool for detection of FIXME, TODO and other comment keywords",
468+
"desc": "Detects usage of FIXME, TODO and other keywords inside comments",
485469
"loadMode": 8199,
486470
"inPresets": [
487471
"style",
@@ -907,7 +891,7 @@
907891
},
908892
{
909893
"name": "nilnesserr",
910-
"desc": "Reports constructs that checks for err != nil, but returns a different nil value error. Powered by nilness and nilerr.",
894+
"desc": "Reports constructs that checks for err != nil, but returns a different nil value error.\nPowered by nilness and nilerr.",
911895
"loadMode": 8767,
912896
"inPresets": [
913897
"bugs"
@@ -1208,7 +1192,12 @@
12081192
"originalURL": "https://github.com/sivchari/tenv",
12091193
"internal": false,
12101194
"isSlow": true,
1211-
"since": "v1.43.0"
1195+
"since": "v1.43.0",
1196+
"deprecation": {
1197+
"since": "v1.64.0",
1198+
"message": "Duplicate feature another linter.",
1199+
"replacement": "usetesting"
1200+
}
12121201
},
12131202
{
12141203
"name": "testableexamples",

0 commit comments

Comments
 (0)