@@ -539,6 +539,9 @@ linters:
539
539
# Checks if the exported methods of a structure are placed before the non-exported ones.
540
540
# Default: true
541
541
struct-method : false
542
+ # Checks if the constructors and/or structure methods are sorted alphabetically.
543
+ # Default: false
544
+ alphabetical : true
542
545
543
546
funlen :
544
547
# Checks the number of lines in a function.
@@ -642,7 +645,7 @@ linters:
642
645
# Exclude strings matching the given regular expression.
643
646
# Default: ""
644
647
ignore-string-values :
645
- - ' foo.+'
648
+ - " foo.+"
646
649
# Detects constants with identical values.
647
650
# Default: false
648
651
find-duplicates : true
@@ -1167,7 +1170,7 @@ linters:
1167
1170
#
1168
1171
# The option is passed to the ruleguard 'debug-group' argument.
1169
1172
# Default: ""
1170
- debug : ' emptyDecl'
1173
+ debug : " emptyDecl"
1171
1174
# Determines the behavior when an error occurs while parsing ruleguard files.
1172
1175
# If flag is not set, log error and skip rule files that contain an error.
1173
1176
# If flag is set, the value must be a comma-separated list of error conditions.
@@ -1182,7 +1185,7 @@ linters:
1182
1185
# The placeholder '${config-path}' is substituted with a path relative to the configuration file.
1183
1186
# Glob patterns such as 'rules-*.go' may be specified.
1184
1187
# Default: ""
1185
- rules : ' ${base-path}/ruleguard/rules-*.go,${base-path}/myrule1.go'
1188
+ rules : " ${base-path}/ruleguard/rules-*.go,${base-path}/myrule1.go"
1186
1189
# Comma-separated list of enabled groups or skip empty to enable everything.
1187
1190
# Tags can be defined with # character prefix.
1188
1191
# Default: "<all>"
@@ -1533,11 +1536,11 @@ linters:
1533
1536
#
1534
1537
# Default: []
1535
1538
escape-hatches :
1536
- - ' github.com/nicksnyder/go-i18n/v2/i18n.Message'
1537
- - ' example.com/your/project/i18n/markers.Raw'
1538
- - ' example.com/your/project/i18n/markers.OK'
1539
- - ' example.com/your/project/i18n/markers.TODO'
1540
- - ' command-line-arguments.Simple'
1539
+ - " github.com/nicksnyder/go-i18n/v2/i18n.Message"
1540
+ - " example.com/your/project/i18n/markers.Raw"
1541
+ - " example.com/your/project/i18n/markers.OK"
1542
+ - " example.com/your/project/i18n/markers.TODO"
1543
+ - " command-line-arguments.Simple"
1541
1544
# List of Unicode scripts to watch for any usage in string literals.
1542
1545
# https://pkg.go.dev/unicode#pkg-variables
1543
1546
#
@@ -1886,9 +1889,9 @@ linters:
1886
1889
# For example: https://github.com/timonwong/loggercheck/blob/7395ab86595781e33f7afba27ad7b55e6956ebcd/testdata/custom-rules.txt
1887
1890
# Default: empty
1888
1891
rules :
1889
- - k8s.io/klog/v2.InfoS # package level exported functions
1890
- - (github.com/go-logr/logr.Logger).Error # "Methods"
1891
- - (*go.uber.org/zap.SugaredLogger).With # Also "Methods", but with a pointer receiver
1892
+ - k8s.io/klog/v2.InfoS # package level exported functions
1893
+ - (github.com/go-logr/logr.Logger).Error # "Methods"
1894
+ - (*go.uber.org/zap.SugaredLogger).With # Also "Methods", but with a pointer receiver
1892
1895
1893
1896
maintidx :
1894
1897
# Show functions with maintainability index lower than N.
@@ -1941,9 +1944,9 @@ linters:
1941
1944
# Values always ignored: "1", "1.0", "0" and "0.0".
1942
1945
# Default: []
1943
1946
ignored-numbers :
1944
- - ' 0666'
1945
- - ' 0755'
1946
- - ' 42 '
1947
+ - " 0666"
1948
+ - " 0755"
1949
+ - " 42 "
1947
1950
# List of file patterns to exclude from analysis.
1948
1951
# Values always ignored: `.+_test.go`.
1949
1952
# Default: []
@@ -2011,7 +2014,7 @@ linters:
2011
2014
allow-unused : true
2012
2015
# Exclude following linters from requiring an explanation.
2013
2016
# Default: []
2014
- allow-no-explanation : [ ]
2017
+ allow-no-explanation : []
2015
2018
# Enable to require an explanation of nonzero length after each nolint directive.
2016
2019
# Default: false
2017
2020
require-explanation : true
@@ -2199,7 +2202,7 @@ linters:
2199
2202
severity : warning
2200
2203
disabled : false
2201
2204
exclude : [""]
2202
- arguments : [ 4 ]
2205
+ arguments : [4 ]
2203
2206
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#atomic
2204
2207
- name : atomic
2205
2208
severity : warning
@@ -2210,7 +2213,7 @@ linters:
2210
2213
severity : warning
2211
2214
disabled : false
2212
2215
exclude : [""]
2213
- arguments : [ "Ω","Σ","σ", "7" ]
2216
+ arguments : ["Ω", "Σ", "σ", "7"]
2214
2217
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#bare-return
2215
2218
- name : bare-return
2216
2219
severity : warning
@@ -2236,7 +2239,7 @@ linters:
2236
2239
severity : warning
2237
2240
disabled : false
2238
2241
exclude : [""]
2239
- arguments : [ 7 ]
2242
+ arguments : [7 ]
2240
2243
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#comment-spacings
2241
2244
- name : comment-spacings
2242
2245
severity : warning
@@ -2250,7 +2253,7 @@ linters:
2250
2253
severity : warning
2251
2254
disabled : false
2252
2255
exclude : [""]
2253
- arguments : [ 15 ]
2256
+ arguments : [15 ]
2254
2257
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#confusing-naming
2255
2258
- name : confusing-naming
2256
2259
severity : warning
@@ -2283,7 +2286,7 @@ linters:
2283
2286
severity : warning
2284
2287
disabled : false
2285
2288
exclude : [""]
2286
- arguments : [ 3 ]
2289
+ arguments : [3 ]
2287
2290
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#datarace
2288
2291
- name : datarace
2289
2292
severity : warning
@@ -2312,7 +2315,8 @@ linters:
2312
2315
disabled : false
2313
2316
exclude : [""]
2314
2317
arguments :
2315
- - allowed-packages : ["github.com/onsi/ginkgo/v2", "github.com/onsi/gomega"]
2318
+ - allowed-packages :
2319
+ ["github.com/onsi/ginkgo/v2", "github.com/onsi/gomega"]
2316
2320
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#duplicated-imports
2317
2321
- name : duplicated-imports
2318
2322
severity : warning
@@ -2430,13 +2434,13 @@ linters:
2430
2434
severity : warning
2431
2435
disabled : false
2432
2436
exclude : [""]
2433
- arguments : [ 10, 0 ]
2437
+ arguments : [10, 0]
2434
2438
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#function-result-limit
2435
2439
- name : function-result-limit
2436
2440
severity : warning
2437
2441
disabled : false
2438
2442
exclude : [""]
2439
- arguments : [ 3 ]
2443
+ arguments : [3 ]
2440
2444
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#get-return
2441
2445
- name : get-return
2442
2446
severity : warning
@@ -2492,19 +2496,19 @@ linters:
2492
2496
severity : warning
2493
2497
disabled : false
2494
2498
exclude : [""]
2495
- arguments : [ 80 ]
2499
+ arguments : [80 ]
2496
2500
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#max-control-nesting
2497
2501
- name : max-control-nesting
2498
2502
severity : warning
2499
2503
disabled : false
2500
2504
exclude : [""]
2501
- arguments : [ 3 ]
2505
+ arguments : [3 ]
2502
2506
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#max-public-structs
2503
2507
- name : max-public-structs
2504
2508
severity : warning
2505
2509
disabled : false
2506
2510
exclude : [""]
2507
- arguments : [ 3 ]
2511
+ arguments : [3 ]
2508
2512
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#modifies-parameter
2509
2513
- name : modifies-parameter
2510
2514
severity : warning
@@ -2578,10 +2582,10 @@ linters:
2578
2582
disabled : false
2579
2583
exclude : [""]
2580
2584
arguments :
2581
- - - ' core.WriteError[1].Message'
2582
- - ' /^([^A-Z]|$)/'
2585
+ - - " core.WriteError[1].Message"
2586
+ - " /^([^A-Z]|$)/"
2583
2587
- must not start with a capital letter
2584
- - - ' fmt.Errorf[0]'
2588
+ - - " fmt.Errorf[0]"
2585
2589
- ' /(^|[^\.!?])$/'
2586
2590
- must not end in punctuation
2587
2591
- - panic
@@ -2697,8 +2701,8 @@ linters:
2697
2701
disabled : false
2698
2702
exclude : [""]
2699
2703
arguments :
2700
- - [ "ID" ] # AllowList
2701
- - [ "VM" ] # DenyList
2704
+ - ["ID"] # AllowList
2705
+ - ["VM"] # DenyList
2702
2706
- - upper-case-const : true # Extra parameter (upper-case-const|skip-package-name-checks)
2703
2707
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#waitgroup-by-value
2704
2708
- name : waitgroup-by-value
@@ -2805,10 +2809,54 @@ linters:
2805
2809
- fmt
2806
2810
# https://staticcheck.dev/docs/configuration/options/#initialisms
2807
2811
# Default: ["ACL", "API", "ASCII", "CPU", "CSS", "DNS", "EOF", "GUID", "HTML", "HTTP", "HTTPS", "ID", "IP", "JSON", "QPS", "RAM", "RPC", "SLA", "SMTP", "SQL", "SSH", "TCP", "TLS", "TTL", "UDP", "UI", "GID", "UID", "UUID", "URI", "URL", "UTF8", "VM", "XML", "XMPP", "XSRF", "XSS", "SIP", "RTP", "AMQP", "DB", "TS"]
2808
- initialisms : [ "ACL", "API", "ASCII", "CPU", "CSS", "DNS", "EOF", "GUID", "HTML", "HTTP", "HTTPS", "ID", "IP", "JSON", "QPS", "RAM", "RPC", "SLA", "SMTP", "SQL", "SSH", "TCP", "TLS", "TTL", "UDP", "UI", "GID", "UID", "UUID", "URI", "URL", "UTF8", "VM", "XML", "XMPP", "XSRF", "XSS", "SIP", "RTP", "AMQP", "DB", "TS" ]
2812
+ initialisms :
2813
+ [
2814
+ " ACL" ,
2815
+ " API" ,
2816
+ " ASCII" ,
2817
+ " CPU" ,
2818
+ " CSS" ,
2819
+ " DNS" ,
2820
+ " EOF" ,
2821
+ " GUID" ,
2822
+ " HTML" ,
2823
+ " HTTP" ,
2824
+ " HTTPS" ,
2825
+ " ID" ,
2826
+ " IP" ,
2827
+ " JSON" ,
2828
+ " QPS" ,
2829
+ " RAM" ,
2830
+ " RPC" ,
2831
+ " SLA" ,
2832
+ " SMTP" ,
2833
+ " SQL" ,
2834
+ " SSH" ,
2835
+ " TCP" ,
2836
+ " TLS" ,
2837
+ " TTL" ,
2838
+ " UDP" ,
2839
+ " UI" ,
2840
+ " GID" ,
2841
+ " UID" ,
2842
+ " UUID" ,
2843
+ " URI" ,
2844
+ " URL" ,
2845
+ " UTF8" ,
2846
+ " VM" ,
2847
+ " XML" ,
2848
+ " XMPP" ,
2849
+ " XSRF" ,
2850
+ " XSS" ,
2851
+ " SIP" ,
2852
+ " RTP" ,
2853
+ " AMQP" ,
2854
+ " DB" ,
2855
+ " TS" ,
2856
+ ]
2809
2857
# https://staticcheck.dev/docs/configuration/options/#http_status_code_whitelist
2810
2858
# Default: ["200", "400", "404", "500"]
2811
- http-status-code-whitelist : [ "200", "400", "404", "500" ]
2859
+ http-status-code-whitelist : ["200", "400", "404", "500"]
2812
2860
# SAxxxx checks in https://staticcheck.dev/docs/configuration/options/#checks
2813
2861
# Example (to disable some checks): [ "all", "-SA1000", "-SA1001"]
2814
2862
# Default: ["all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022"]
@@ -3404,8 +3452,7 @@ linters:
3404
3452
# Overrides the default/root configuration.
3405
3453
# Default: []
3406
3454
overrides :
3407
- -
3408
- # The package path (uses `/` only as a separator).
3455
+ - # The package path (uses `/` only as a separator).
3409
3456
# Required
3410
3457
pkg : foo/bar
3411
3458
# Default: empty or the same as the default/root configuration.
@@ -3835,12 +3882,12 @@ linters:
3835
3882
3836
3883
# A list of call idents that everything can be cuddled with.
3837
3884
# Defaults: [ "Lock", "RLock" ]
3838
- allow-cuddle-with-calls : [ "Foo", "Bar" ]
3885
+ allow-cuddle-with-calls : ["Foo", "Bar"]
3839
3886
3840
3887
# AllowCuddleWithRHS is a list of right hand side variables that is allowed
3841
3888
# to be cuddled with anything.
3842
3889
# Defaults: [ "Unlock", "RUnlock" ]
3843
- allow-cuddle-with-rhs : [ "Foo", "Bar" ]
3890
+ allow-cuddle-with-rhs : ["Foo", "Bar"]
3844
3891
3845
3892
# Allow cuddling with any block as long as the variable is used somewhere in
3846
3893
# the block.
@@ -3857,7 +3904,7 @@ linters:
3857
3904
# When force-err-cuddling is enabled this is a list of names
3858
3905
# used for error variables to check for in the conditional.
3859
3906
# Default: [ "err" ]
3860
- error-variable-names : [ "foo" ]
3907
+ error-variable-names : ["foo"]
3861
3908
3862
3909
# Causes an error if a short declaration (:=) cuddles with anything other than
3863
3910
# another short declaration.
@@ -3979,13 +4026,13 @@ formatters:
3979
4026
# If `custom-order` is `true`, it follows the order of `sections` option.
3980
4027
# Default: ["standard", "default"]
3981
4028
sections :
3982
- - standard # Standard section: captures all standard packages.
3983
- - default # Default section: contains all imports that could not be matched to another section type.
4029
+ - standard # Standard section: captures all standard packages.
4030
+ - default # Default section: contains all imports that could not be matched to another section type.
3984
4031
- prefix(github.com/org/project) # Custom section: groups all imports with the specified Prefix.
3985
- - blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
3986
- - dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled.
3987
- - alias # Alias section: contains all alias imports. This section is not present unless explicitly enabled.
3988
- - localmodule # Local module section: contains all local packages. This section is not present unless explicitly enabled.
4032
+ - blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
4033
+ - dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled.
4034
+ - alias # Alias section: contains all alias imports. This section is not present unless explicitly enabled.
4035
+ - localmodule # Local module section: contains all local packages. This section is not present unless explicitly enabled.
3989
4036
3990
4037
# Checks that no inline comments are present.
3991
4038
# Default: false
@@ -4012,10 +4059,10 @@ formatters:
4012
4059
# https://pkg.go.dev/cmd/gofmt
4013
4060
# Default: []
4014
4061
rewrite-rules :
4015
- - pattern : ' interface{}'
4016
- replacement : ' any'
4017
- - pattern : ' a[b:len(a)]'
4018
- replacement : ' a[b:]'
4062
+ - pattern : " interface{}"
4063
+ replacement : " any"
4064
+ - pattern : " a[b:len(a)]"
4065
+ replacement : " a[b:]"
4019
4066
4020
4067
gofumpt :
4021
4068
# Module path which contains the source code being formatted.
@@ -4114,7 +4161,6 @@ issues:
4114
4161
# Default: false
4115
4162
fix : true
4116
4163
4117
-
4118
4164
# Output configuration options.
4119
4165
output :
4120
4166
# The formats used to render issues.
@@ -4217,7 +4263,6 @@ output:
4217
4263
# Default: true
4218
4264
show-stats : false
4219
4265
4220
-
4221
4266
# Options for analysis running.
4222
4267
run :
4223
4268
# Timeout for total work, e.g. 30s, 5m, 5m30s.
@@ -4273,14 +4318,13 @@ run:
4273
4318
4274
4319
# Define the Go version limit.
4275
4320
# Default: use Go version from the go.mod file, fallback on the env var `GOVERSION`, fallback on 1.22.
4276
- go : ' 1.23'
4321
+ go : " 1.23"
4277
4322
4278
4323
# Number of operating system threads (`GOMAXPROCS`) that can execute golangci-lint simultaneously.
4279
4324
# Default: 0 (automatically set to match Linux container CPU quota and
4280
4325
# fall back to the number of logical CPUs in the machine)
4281
4326
concurrency : 4
4282
4327
4283
-
4284
4328
severity :
4285
4329
# Set the default severity for issues.
4286
4330
#
0 commit comments