@@ -20,6 +20,7 @@ linters:
20
20
21
21
# Enable specific linter.
22
22
enable :
23
+ - arangolint
23
24
- asasalint
24
25
- asciicheck
25
26
- bidichk
@@ -35,6 +36,7 @@ linters:
35
36
- dupl
36
37
- dupword
37
38
- durationcheck
39
+ - embeddedstructfieldcheck
38
40
- err113
39
41
- errcheck
40
42
- errchkjson
@@ -89,6 +91,7 @@ linters:
89
91
- nilnil
90
92
- nlreturn
91
93
- noctx
94
+ - noinlineerr
92
95
- nolintlint
93
96
- nonamedreturns
94
97
- nosprintfhostport
@@ -123,10 +126,12 @@ linters:
123
126
- whitespace
124
127
- wrapcheck
125
128
- wsl
129
+ - wsl_v5
126
130
- zerologlint
127
131
128
- # Disable specific linter .
132
+ # Disable specific linters .
129
133
disable :
134
+ - arangolint
130
135
- asasalint
131
136
- asciicheck
132
137
- bidichk
@@ -142,6 +147,7 @@ linters:
142
147
- dupl
143
148
- dupword
144
149
- durationcheck
150
+ - embeddedstructfieldcheck
145
151
- err113
146
152
- errcheck
147
153
- errchkjson
@@ -196,6 +202,7 @@ linters:
196
202
- nilnil
197
203
- nlreturn
198
204
- noctx
205
+ - noinlineerr
199
206
- nolintlint
200
207
- nonamedreturns
201
208
- nosprintfhostport
@@ -230,6 +237,7 @@ linters:
230
237
- whitespace
231
238
- wrapcheck
232
239
- wsl
240
+ - wsl_v5
233
241
- zerologlint
234
242
235
243
# All available settings of specific linters.
@@ -383,6 +391,11 @@ linters:
383
391
ignore :
384
392
- " 0C0C"
385
393
394
+ embeddedstructfieldcheck :
395
+ # Checks that sync.Mutex and sync.RWMutex are not used as embedded fields.
396
+ # Default: false
397
+ forbid-mutex : true
398
+
386
399
errcheck :
387
400
# Report about not checking of errors in type assertions: `a := b.(MyStruct)`.
388
401
# Such cases aren't reported by default.
@@ -406,6 +419,10 @@ linters:
406
419
- io.Copy(*bytes.Buffer)
407
420
- io.Copy(os.Stdout)
408
421
422
+ # Display function signature instead of selector.
423
+ # Default: false
424
+ verbose : true
425
+
409
426
errchkjson :
410
427
# With check-error-free-encoding set to true, errchkjson does warn about errors
411
428
# from json encoding functions that are safe to be ignored,
@@ -541,6 +558,9 @@ linters:
541
558
# Checks if the exported methods of a structure are placed before the non-exported ones.
542
559
# Default: true
543
560
struct-method : false
561
+ # Checks if the constructors and/or structure methods are sorted alphabetically.
562
+ # Default: false
563
+ alphabetical : true
544
564
545
565
funlen :
546
566
# Checks the number of lines in a function.
@@ -1295,6 +1315,9 @@ linters:
1295
1315
# Forbid the use of the `exclude` directives.
1296
1316
# Default: false
1297
1317
exclude-forbidden : true
1318
+ # Forbid the use of the `ignore` directives (>= go1.25).
1319
+ # Default: false
1320
+ ignore-forbidden : true
1298
1321
# Forbid the use of the `toolchain` directive.
1299
1322
# Default: false
1300
1323
toolchain-forbidden : true
@@ -1599,6 +1622,8 @@ linters:
1599
1622
- findcall
1600
1623
# Report assembly that clobbers the frame pointer before saving it.
1601
1624
- framepointer
1625
+ # Check format of addresses passed to net.Dial.
1626
+ - hostport
1602
1627
# Report using Go 1.22 enhanced ServeMux patterns in older Go versions.
1603
1628
- httpmux
1604
1629
# Check for mistakes using HTTP responses.
@@ -1682,6 +1707,7 @@ linters:
1682
1707
- fieldalignment
1683
1708
- findcall
1684
1709
- framepointer
1710
+ - hostport
1685
1711
- httpmux
1686
1712
- httpresponse
1687
1713
- ifaceassert
@@ -1776,6 +1802,7 @@ linters:
1776
1802
- identical # Identifies interfaces in the same package that have identical method sets.
1777
1803
- unused # Identifies interfaces that are not used anywhere in the same package where the interface is defined.
1778
1804
- opaque # Identifies functions that return interfaces, but the actual returned value is always a single concrete implementation.
1805
+ - unexported # Identifies interfaces that are not exported but are used in exported functions or methods.
1779
1806
settings :
1780
1807
unused :
1781
1808
# List of packages path to exclude from the check.
@@ -2302,11 +2329,12 @@ linters:
2302
2329
disabled : false
2303
2330
exclude : [""]
2304
2331
arguments :
2305
- - - "call-chain"
2306
- - " loop"
2307
- - " method-call"
2308
- - " recover"
2309
- - " return"
2332
+ - " call-chain"
2333
+ - " loop"
2334
+ - " method-call"
2335
+ - " recover"
2336
+ - " immediate-recover"
2337
+ - " return"
2310
2338
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#dot-imports
2311
2339
- name : dot-imports
2312
2340
severity : warning
@@ -2568,7 +2596,7 @@ linters:
2568
2596
severity : warning
2569
2597
disabled : false
2570
2598
exclude : [""]
2571
- # https://github.com/mgechev/revive/blob/master /RULES_DESCRIPTIONS.md#redundant-test-main-exit
2599
+ # https://github.com/mgechev/revive/blob/HEAD /RULES_DESCRIPTIONS.md#redundant-test-main-exit
2572
2600
- name : redundant-test-main-exit
2573
2601
severity : warning
2574
2602
disabled : false
@@ -2608,6 +2636,11 @@ linters:
2608
2636
exclude : [""]
2609
2637
arguments :
2610
2638
- " preserve-scope"
2639
+ # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#time-date
2640
+ - name : time-date
2641
+ severity : warning
2642
+ disabled : false
2643
+ exclude : [""]
2611
2644
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#time-equal
2612
2645
- name : time-equal
2613
2646
severity : warning
@@ -2648,6 +2681,11 @@ linters:
2648
2681
arguments :
2649
2682
- " fmt.Printf"
2650
2683
- " myFunction"
2684
+ # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unnecessary-format
2685
+ - name : unnecessary-format
2686
+ severity : warning
2687
+ disabled : false
2688
+ exclude : [""]
2651
2689
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unnecessary-stmt
2652
2690
- name : unnecessary-stmt
2653
2691
severity : warning
@@ -2682,6 +2720,11 @@ linters:
2682
2720
severity : warning
2683
2721
disabled : false
2684
2722
exclude : [""]
2723
+ # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#use-fmt-print
2724
+ - name : use-fmt-print
2725
+ severity : warning
2726
+ disabled : false
2727
+ exclude : [""]
2685
2728
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#useless-break
2686
2729
- name : useless-break
2687
2730
severity : warning
@@ -2812,6 +2855,7 @@ linters:
2812
2855
http-status-code-whitelist : [ "200", "400", "404", "500" ]
2813
2856
# SAxxxx checks in https://staticcheck.dev/docs/configuration/options/#checks
2814
2857
# Example (to disable some checks): [ "all", "-SA1000", "-SA1001"]
2858
+ # Run `GL_DEBUG=staticcheck golangci-lint run --enable=staticcheck` to see all available checks and enabled by config checks.
2815
2859
# Default: ["all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022"]
2816
2860
checks :
2817
2861
# Invalid regular expression.
@@ -3595,6 +3639,9 @@ linters:
3595
3639
# Suggest the use of http.StatusXX.
3596
3640
# Default: true
3597
3641
http-status-code : false
3642
+ # Suggest the use of time.Month in time.Date.
3643
+ # Default: false
3644
+ time-date-month : true
3598
3645
# Suggest the use of time.Weekday.String().
3599
3646
# Default: true
3600
3647
time-weekday : true
@@ -3644,13 +3691,13 @@ linters:
3644
3691
3645
3692
# Enable/disable `context.Background()` detections.
3646
3693
# Disabled if Go < 1.24.
3647
- # Default: true
3648
- context-background : false
3694
+ # Default: false
3695
+ context-background : true
3649
3696
3650
3697
# Enable/disable `context.TODO()` detections.
3651
3698
# Disabled if Go < 1.24.
3652
- # Default: true
3653
- context-todo : false
3699
+ # Default: false
3700
+ context-todo : true
3654
3701
3655
3702
unconvert :
3656
3703
# Remove conversions that force intermediate rounding.
@@ -3867,6 +3914,93 @@ linters:
3867
3914
# Default: false
3868
3915
force-short-decl-cuddling : true
3869
3916
3917
+ wsl_v5 :
3918
+ # Allow cuddling a variable if it's used first in the immediate following block,
3919
+ # even if the statement with the block doesn't use the variable.
3920
+ # https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#configuration
3921
+ # Default: true
3922
+ allow-first-in-block : false
3923
+
3924
+ # Same as above,
3925
+ # but allows cuddling if the variable is used anywhere in the following (or nested) block.
3926
+ # https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#configuration
3927
+ # Default: false
3928
+ allow-whole-block : true
3929
+
3930
+ # If a block contains more than this number of lines,
3931
+ # the branch statement needs to be separated by whitespace.
3932
+ # https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#configuration
3933
+ # Default: 2
3934
+ branch-max-lines : 4
3935
+
3936
+ # If set to a non-negative number,
3937
+ # case blocks need to end with whitespace if exceeding this number
3938
+ # https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#configuration
3939
+ # Default: 0
3940
+ case-max-lines : 2
3941
+
3942
+ # Default checks to use.
3943
+ # Can be `all`, `none`, `default` or empty.
3944
+ # https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#checks-and-configuration
3945
+ # Default: ""
3946
+ default : all
3947
+
3948
+ # Enabled checks.
3949
+ # Will be additive to any presets.
3950
+ # https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#checks-and-configuration
3951
+ # Default: []
3952
+ enable :
3953
+ - assign
3954
+ - branch
3955
+ - decl
3956
+ - defer
3957
+ - expr
3958
+ - for
3959
+ - go
3960
+ - if
3961
+ - inc-dec
3962
+ - label
3963
+ - range
3964
+ - return
3965
+ - select
3966
+ - send
3967
+ - switch
3968
+ - type-switch
3969
+ - append
3970
+ - assign-exclusive
3971
+ - assign-expr
3972
+ - err
3973
+ - leading-whitespace
3974
+ - trailing-whitespace
3975
+
3976
+ # Disable checks.
3977
+ # Will be subtractive to any preset.
3978
+ # https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#checks-and-configuration
3979
+ # Default: []
3980
+ disable :
3981
+ - assign
3982
+ - branch
3983
+ - decl
3984
+ - defer
3985
+ - expr
3986
+ - for
3987
+ - go
3988
+ - if
3989
+ - inc-dec
3990
+ - label
3991
+ - range
3992
+ - return
3993
+ - select
3994
+ - send
3995
+ - switch
3996
+ - type-switch
3997
+ - append
3998
+ - assign-exclusive
3999
+ - assign-expr
4000
+ - err
4001
+ - leading-whitespace
4002
+ - trailing-whitespace
4003
+
3870
4004
# The custom section can be used to define linter plugins to be loaded at runtime.
3871
4005
# See README documentation for more info.
3872
4006
custom :
@@ -3970,6 +4104,7 @@ formatters:
3970
4104
- gofumpt
3971
4105
- goimports
3972
4106
- golines
4107
+ - swaggo
3973
4108
3974
4109
# Formatters settings.
3975
4110
settings :
@@ -4066,6 +4201,7 @@ formatters:
4066
4201
# Default: lax
4067
4202
generated : strict
4068
4203
# Which file paths to exclude.
4204
+ # This option is ignored when using `--stdin` as the path is unknown.
4069
4205
# Default: []
4070
4206
paths :
4071
4207
- " .*\\ .my\\ .go$"
0 commit comments