@@ -31,10 +31,8 @@ linters:
31
31
- errchkjson
32
32
- errname
33
33
- errorlint
34
- - execinquery
35
34
- exhaustive
36
35
- exhaustruct
37
- - exportloopref
38
36
- exptostd
39
37
- fatcontext
40
38
- forbidigo
@@ -106,7 +104,6 @@ linters:
106
104
- stylecheck
107
105
- tagalign
108
106
- tagliatelle
109
- - tenv
110
107
- testableexamples
111
108
- testifylint
112
109
- testpackage
@@ -150,10 +147,8 @@ linters:
150
147
- errchkjson
151
148
- errname
152
149
- errorlint
153
- - execinquery
154
150
- exhaustive
155
151
- exhaustruct
156
- - exportloopref
157
152
- exptostd
158
153
- fatcontext
159
154
- forbidigo
@@ -225,7 +220,6 @@ linters:
225
220
- stylecheck
226
221
- tagalign
227
222
- tagliatelle
228
- - tenv
229
223
- testableexamples
230
224
- testifylint
231
225
- testpackage
@@ -243,15 +237,18 @@ linters:
243
237
- wsl
244
238
- zerologlint
245
239
- deadcode # Deprecated
240
+ - execinquery # Deprecated
246
241
- exhaustivestruct # Deprecated
242
+ - exportloopref # Deprecated
247
243
- golint # Deprecated
244
+ - gomnd # Deprecated
248
245
- ifshort # Deprecated
249
246
- interfacer # Deprecated
250
247
- maligned # Deprecated
251
- - gomnd # Deprecated
252
248
- nosnakecase # Deprecated
253
249
- scopelint # Deprecated
254
250
- structcheck # Deprecated
251
+ - tenv # Deprecated
255
252
- varcheck # Deprecated
256
253
257
254
# Enable presets.
@@ -548,6 +545,12 @@ linters-settings:
548
545
exclude :
549
546
- ' .+/cobra\.Command$'
550
547
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
+
551
554
forbidigo :
552
555
# Forbid the following identifiers (list of regexp).
553
556
# Default: ["^(fmt\\.Print(|f|ln)|print|println)$"]
@@ -1841,7 +1844,7 @@ linters-settings:
1841
1844
- sortslice
1842
1845
# Check signature of methods of well-known interfaces.
1843
1846
- stdmethods
1844
- # Check for uses of too-new standard library symbols.
1847
+ # Report uses of too-new standard library symbols.
1845
1848
- stdversion
1846
1849
# Check for string(int) conversions.
1847
1850
- stringintconv
@@ -1863,7 +1866,7 @@ linters-settings:
1863
1866
- unusedresult
1864
1867
# Checks for unused writes.
1865
1868
- unusedwrite
1866
- # Checks for misuses of sync.WaitGroup.
1869
+ # Check for misuses of sync.WaitGroup.
1867
1870
- waitgroup
1868
1871
1869
1872
# Enable all analyzers.
@@ -1908,6 +1911,7 @@ linters-settings:
1908
1911
- slog
1909
1912
- sortslice
1910
1913
- stdmethods
1914
+ - stdversion
1911
1915
- stringintconv
1912
1916
- structtag
1913
1917
- testinggoroutine
@@ -1918,6 +1922,7 @@ linters-settings:
1918
1922
- unsafeptr
1919
1923
- unusedresult
1920
1924
- unusedwrite
1925
+ - waitgroup
1921
1926
1922
1927
# Settings per analyzer.
1923
1928
settings :
@@ -2238,23 +2243,37 @@ linters-settings:
2238
2243
# still required to have `t.Parallel`, but subtests are allowed to skip it.
2239
2244
# Default: false
2240
2245
ignore-missing-subtests : true
2241
-
2242
2246
perfsprint :
2247
+ # Enable/disable optimization of integer formatting.
2248
+ # Default: true
2249
+ integer-format : false
2243
2250
# Optimizes even if it requires an int or uint type cast.
2244
2251
# Default: true
2245
2252
int-conversion : false
2253
+ # Enable/disable optimization of error formatting.
2254
+ # Default: true
2255
+ error-format : false
2246
2256
# Optimizes into `err.Error()` even if it is only equivalent for non-nil errors.
2247
2257
# Default: false
2248
2258
err-error : true
2249
2259
# Optimizes `fmt.Errorf`.
2250
2260
# Default: true
2251
2261
errorf : false
2262
+ # Enable/disable optimization of string formatting.
2263
+ # Default: true
2264
+ string-format : false
2252
2265
# Optimizes `fmt.Sprintf` with only one argument.
2253
2266
# Default: true
2254
2267
sprintf1 : false
2255
2268
# Optimizes into strings concatenation.
2256
2269
# Default: true
2257
2270
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
2258
2277
2259
2278
prealloc :
2260
2279
# IMPORTANT: we don't recommend using this linter before doing performance profiling.
@@ -2371,7 +2390,7 @@ linters-settings:
2371
2390
# This means that linting errors with less than 0.8 confidence will be ignored.
2372
2391
# Default: 0.8
2373
2392
confidence : 0.1
2374
-
2393
+ # Run `GL_DEBUG=revive golangci-lint run --enable-only=revive` to see default, all available rules, and enabled rules.
2375
2394
rules :
2376
2395
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#add-constant
2377
2396
- name : add-constant
@@ -2508,6 +2527,7 @@ linters-settings:
2508
2527
exclude : [""]
2509
2528
arguments :
2510
2529
- " preserveScope"
2530
+ - " allowJump"
2511
2531
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#empty-block
2512
2532
- name : empty-block
2513
2533
severity : warning
@@ -2591,7 +2611,7 @@ linters-settings:
2591
2611
disabled : false
2592
2612
exclude : [""]
2593
2613
arguments :
2594
- - " ^[_a-z][_a-z0-9]*.go$"
2614
+ - " ^[_a-z][_a-z0-9]*\\ .go$"
2595
2615
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#flag-parameter
2596
2616
- name : flag-parameter
2597
2617
severity : warning
@@ -2726,6 +2746,11 @@ linters-settings:
2726
2746
severity : warning
2727
2747
disabled : false
2728
2748
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 : [""]
2729
2754
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#redundant-import-alias
2730
2755
- name : redundant-import-alias
2731
2756
severity : warning
@@ -2835,6 +2860,11 @@ linters-settings:
2835
2860
severity : warning
2836
2861
disabled : false
2837
2862
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 : [""]
2838
2868
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#useless-break
2839
2869
- name : useless-break
2840
2870
severity : warning
@@ -3639,8 +3669,8 @@ linters-settings:
3639
3669
os-mkdir-temp : false
3640
3670
3641
3671
# Enable/disable `os.Setenv()` detections.
3642
- # Default: false
3643
- os-setenv : true
3672
+ # Default: true
3673
+ os-setenv : false
3644
3674
3645
3675
# Enable/disable `os.TempDir()` detections.
3646
3676
# Default: false
@@ -4026,6 +4056,10 @@ issues:
4026
4056
# Default: false
4027
4057
new : true
4028
4058
4059
+ # Show only new issues created after the best common ancestor (merge-base against HEAD).
4060
+ # Default: ""
4061
+ new-from-merge-base : main
4062
+
4029
4063
# Show only new issues created after git revision `REV`.
4030
4064
# Default: ""
4031
4065
new-from-rev : HEAD
@@ -4124,6 +4158,16 @@ run:
4124
4158
# Default: 1m
4125
4159
timeout : 5m
4126
4160
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
+
4127
4171
# Exit code when at least one issue was found.
4128
4172
# Default: 1
4129
4173
issues-exit-code : 2
0 commit comments