1
+ # yaml-language-server: $schema=https://golangci-lint.run/jsonschema/golangci.jsonschema.json
1
2
# This file contains all available configuration options
2
3
# with their default values (in comments).
3
4
#
@@ -276,7 +277,6 @@ linters:
276
277
# Default: false
277
278
fast : true
278
279
279
-
280
280
# All available settings of specific linters.
281
281
linters-settings :
282
282
asasalint :
@@ -590,13 +590,13 @@ linters-settings:
590
590
# If `custom-order` is `true`, it follows the order of `sections` option.
591
591
# Default: ["standard", "default"]
592
592
sections :
593
- - standard # Standard section: captures all standard packages.
594
- - default # Default section: contains all imports that could not be matched to another section type.
593
+ - standard # Standard section: captures all standard packages.
594
+ - default # Default section: contains all imports that could not be matched to another section type.
595
595
- prefix(github.com/org/project) # Custom section: groups all imports with the specified Prefix.
596
- - blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
597
- - dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled.
598
- - alias # Alias section: contains all alias imports. This section is not present unless explicitly enabled.
599
- - localmodule # Local module section: contains all local packages. This section is not present unless explicitly enabled.
596
+ - blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
597
+ - dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled.
598
+ - alias # Alias section: contains all alias imports. This section is not present unless explicitly enabled.
599
+ - localmodule # Local module section: contains all local packages. This section is not present unless explicitly enabled.
600
600
601
601
# Checks that no inline Comments are present.
602
602
# Default: false
@@ -710,7 +710,7 @@ linters-settings:
710
710
ignore-calls : false
711
711
# Exclude strings matching the given regular expression.
712
712
# Default: ""
713
- ignore-strings : ' foo.+'
713
+ ignore-strings : " foo.+"
714
714
715
715
gocritic :
716
716
# Disable all checks.
@@ -1229,7 +1229,7 @@ linters-settings:
1229
1229
#
1230
1230
# The option is passed to the ruleguard 'debug-group' argument.
1231
1231
# Default: ""
1232
- debug : ' emptyDecl'
1232
+ debug : " emptyDecl"
1233
1233
# Determines the behavior when an error occurs while parsing ruleguard files.
1234
1234
# If flag is not set, log error and skip rule files that contain an error.
1235
1235
# If flag is set, the value must be a comma-separated list of error conditions.
@@ -1243,7 +1243,7 @@ linters-settings:
1243
1243
# The special '${configDir}' variable is substituted with the absolute directory containing the golangci config file.
1244
1244
# Glob patterns such as 'rules-*.go' may be specified.
1245
1245
# Default: ""
1246
- rules : ' ${configDir}/ruleguard/rules-*.go,${configDir}/myrule1.go'
1246
+ rules : " ${configDir}/ruleguard/rules-*.go,${configDir}/myrule1.go"
1247
1247
# Comma-separated list of enabled groups or skip empty to enable everything.
1248
1248
# Tags can be defined with # character prefix.
1249
1249
# Default: "<all>"
@@ -1308,10 +1308,10 @@ linters-settings:
1308
1308
# https://pkg.go.dev/cmd/gofmt
1309
1309
# Default: []
1310
1310
rewrite-rules :
1311
- - pattern : ' interface{}'
1312
- replacement : ' any'
1313
- - pattern : ' a[b:len(a)]'
1314
- replacement : ' a[b:]'
1311
+ - pattern : " interface{}"
1312
+ replacement : " any"
1313
+ - pattern : " a[b:len(a)]"
1314
+ replacement : " a[b:]"
1315
1315
1316
1316
gofumpt :
1317
1317
# Module path which contains the source code being formatted.
@@ -1737,11 +1737,11 @@ linters-settings:
1737
1737
#
1738
1738
# Default: []
1739
1739
escape-hatches :
1740
- - ' github.com/nicksnyder/go-i18n/v2/i18n.Message'
1741
- - ' example.com/your/project/i18n/markers.Raw'
1742
- - ' example.com/your/project/i18n/markers.OK'
1743
- - ' example.com/your/project/i18n/markers.TODO'
1744
- - ' command-line-arguments.Simple'
1740
+ - " github.com/nicksnyder/go-i18n/v2/i18n.Message"
1741
+ - " example.com/your/project/i18n/markers.Raw"
1742
+ - " example.com/your/project/i18n/markers.OK"
1743
+ - " example.com/your/project/i18n/markers.TODO"
1744
+ - " command-line-arguments.Simple"
1745
1745
# Ignore test files.
1746
1746
#
1747
1747
# Default: true
@@ -2089,9 +2089,9 @@ linters-settings:
2089
2089
# For example: https://github.com/timonwong/loggercheck/blob/7395ab86595781e33f7afba27ad7b55e6956ebcd/testdata/custom-rules.txt
2090
2090
# Default: empty
2091
2091
rules :
2092
- - k8s.io/klog/v2.InfoS # package level exported functions
2093
- - (github.com/go-logr/logr.Logger).Error # "Methods"
2094
- - (*go.uber.org/zap.SugaredLogger).With # Also "Methods", but with a pointer receiver
2092
+ - k8s.io/klog/v2.InfoS # package level exported functions
2093
+ - (github.com/go-logr/logr.Logger).Error # "Methods"
2094
+ - (*go.uber.org/zap.SugaredLogger).With # Also "Methods", but with a pointer receiver
2095
2095
2096
2096
maintidx :
2097
2097
# Show functions with maintainability index lower than N.
@@ -2144,9 +2144,9 @@ linters-settings:
2144
2144
# Values always ignored: "1", "1.0", "0" and "0.0"
2145
2145
# Default: []
2146
2146
ignored-numbers :
2147
- - ' 0666'
2148
- - ' 0755'
2149
- - ' 42 '
2147
+ - " 0666"
2148
+ - " 0755"
2149
+ - " 42 "
2150
2150
# List of file patterns to exclude from analysis.
2151
2151
# Values always ignored: `.+_test.go`
2152
2152
# Default: []
@@ -2209,7 +2209,7 @@ linters-settings:
2209
2209
allow-unused : true
2210
2210
# Exclude following linters from requiring an explanation.
2211
2211
# Default: []
2212
- allow-no-explanation : [ ]
2212
+ allow-no-explanation : []
2213
2213
# Enable to require an explanation of nonzero length after each nolint directive.
2214
2214
# Default: false
2215
2215
require-explanation : true
@@ -2295,7 +2295,6 @@ linters-settings:
2295
2295
# UnitAbbreviations detects abbreviated units in the metric name.
2296
2296
- UnitAbbreviations
2297
2297
2298
-
2299
2298
protogetter :
2300
2299
# Skip files generated by specified generators from the checking.
2301
2300
# Checks only the file's initial comment, which must follow the format: "// Code generated by <generator-name>".
@@ -2380,7 +2379,7 @@ linters-settings:
2380
2379
severity : warning
2381
2380
disabled : false
2382
2381
exclude : [""]
2383
- arguments : [ 4 ]
2382
+ arguments : [4 ]
2384
2383
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#atomic
2385
2384
- name : atomic
2386
2385
severity : warning
@@ -2391,7 +2390,7 @@ linters-settings:
2391
2390
severity : warning
2392
2391
disabled : false
2393
2392
exclude : [""]
2394
- arguments : [ "Ω","Σ","σ", "7" ]
2393
+ arguments : ["Ω", "Σ", "σ", "7"]
2395
2394
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#bare-return
2396
2395
- name : bare-return
2397
2396
severity : warning
@@ -2417,7 +2416,7 @@ linters-settings:
2417
2416
severity : warning
2418
2417
disabled : false
2419
2418
exclude : [""]
2420
- arguments : [ 7 ]
2419
+ arguments : [7 ]
2421
2420
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#comment-spacings
2422
2421
- name : comment-spacings
2423
2422
severity : warning
@@ -2431,7 +2430,7 @@ linters-settings:
2431
2430
severity : warning
2432
2431
disabled : false
2433
2432
exclude : [""]
2434
- arguments : [ 15 ]
2433
+ arguments : [15 ]
2435
2434
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#confusing-naming
2436
2435
- name : confusing-naming
2437
2436
severity : warning
@@ -2464,7 +2463,7 @@ linters-settings:
2464
2463
severity : warning
2465
2464
disabled : false
2466
2465
exclude : [""]
2467
- arguments : [ 3 ]
2466
+ arguments : [3 ]
2468
2467
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#datarace
2469
2468
- name : datarace
2470
2469
severity : warning
@@ -2481,13 +2480,13 @@ linters-settings:
2481
2480
disabled : false
2482
2481
exclude : [""]
2483
2482
arguments :
2484
- - [ "call-chain", "loop" ]
2483
+ - ["call-chain", "loop"]
2485
2484
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#dot-imports
2486
2485
- name : dot-imports
2487
2486
severity : warning
2488
2487
disabled : false
2489
2488
exclude : [""]
2490
- arguments : [ ]
2489
+ arguments : []
2491
2490
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#duplicated-imports
2492
2491
- name : duplicated-imports
2493
2492
severity : warning
@@ -2594,13 +2593,13 @@ linters-settings:
2594
2593
severity : warning
2595
2594
disabled : false
2596
2595
exclude : [""]
2597
- arguments : [ 10, 0 ]
2596
+ arguments : [10, 0]
2598
2597
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#function-result-limit
2599
2598
- name : function-result-limit
2600
2599
severity : warning
2601
2600
disabled : false
2602
2601
exclude : [""]
2603
- arguments : [ 3 ]
2602
+ arguments : [3 ]
2604
2603
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#get-return
2605
2604
- name : get-return
2606
2605
severity : warning
@@ -2653,19 +2652,19 @@ linters-settings:
2653
2652
severity : warning
2654
2653
disabled : false
2655
2654
exclude : [""]
2656
- arguments : [ 80 ]
2655
+ arguments : [80 ]
2657
2656
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#max-control-nesting
2658
2657
- name : max-control-nesting
2659
2658
severity : warning
2660
2659
disabled : false
2661
2660
exclude : [""]
2662
- arguments : [ 3 ]
2661
+ arguments : [3 ]
2663
2662
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#max-public-structs
2664
2663
- name : max-public-structs
2665
2664
severity : warning
2666
2665
disabled : false
2667
2666
exclude : [""]
2668
- arguments : [ 3 ]
2667
+ arguments : [3 ]
2669
2668
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#modifies-parameter
2670
2669
- name : modifies-parameter
2671
2670
severity : warning
@@ -2729,10 +2728,10 @@ linters-settings:
2729
2728
disabled : false
2730
2729
exclude : [""]
2731
2730
arguments :
2732
- - - ' core.WriteError[1].Message'
2733
- - ' /^([^A-Z]|$)/'
2731
+ - - " core.WriteError[1].Message"
2732
+ - " /^([^A-Z]|$)/"
2734
2733
- must not start with a capital letter
2735
- - - ' fmt.Errorf[0]'
2734
+ - - " fmt.Errorf[0]"
2736
2735
- ' /(^|[^\.!?])$/'
2737
2736
- must not end in punctuation
2738
2737
- - panic
@@ -2843,8 +2842,8 @@ linters-settings:
2843
2842
disabled : false
2844
2843
exclude : [""]
2845
2844
arguments :
2846
- - [ "ID" ] # AllowList
2847
- - [ "VM" ] # DenyList
2845
+ - ["ID"] # AllowList
2846
+ - ["VM"] # DenyList
2848
2847
- - upperCaseConst : true # Extra parameter (upperCaseConst|skipPackageNameChecks)
2849
2848
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#waitgroup-by-value
2850
2849
- name : waitgroup-by-value
@@ -3236,10 +3235,54 @@ linters-settings:
3236
3235
- fmt
3237
3236
# https://staticcheck.dev/docs/configuration/options/#initialisms
3238
3237
# 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"]
3239
- 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" ]
3238
+ initialisms :
3239
+ [
3240
+ " ACL" ,
3241
+ " API" ,
3242
+ " ASCII" ,
3243
+ " CPU" ,
3244
+ " CSS" ,
3245
+ " DNS" ,
3246
+ " EOF" ,
3247
+ " GUID" ,
3248
+ " HTML" ,
3249
+ " HTTP" ,
3250
+ " HTTPS" ,
3251
+ " ID" ,
3252
+ " IP" ,
3253
+ " JSON" ,
3254
+ " QPS" ,
3255
+ " RAM" ,
3256
+ " RPC" ,
3257
+ " SLA" ,
3258
+ " SMTP" ,
3259
+ " SQL" ,
3260
+ " SSH" ,
3261
+ " TCP" ,
3262
+ " TLS" ,
3263
+ " TTL" ,
3264
+ " UDP" ,
3265
+ " UI" ,
3266
+ " GID" ,
3267
+ " UID" ,
3268
+ " UUID" ,
3269
+ " URI" ,
3270
+ " URL" ,
3271
+ " UTF8" ,
3272
+ " VM" ,
3273
+ " XML" ,
3274
+ " XMPP" ,
3275
+ " XSRF" ,
3276
+ " XSS" ,
3277
+ " SIP" ,
3278
+ " RTP" ,
3279
+ " AMQP" ,
3280
+ " DB" ,
3281
+ " TS" ,
3282
+ ]
3240
3283
# https://staticcheck.dev/docs/configuration/options/#http_status_code_whitelist
3241
3284
# Default: ["200", "400", "404", "500"]
3242
- http-status-code-whitelist : [ "200", "400", "404", "500" ]
3285
+ http-status-code-whitelist : ["200", "400", "404", "500"]
3243
3286
# STxxxx checks in https://staticcheck.dev/docs/configuration/options/#checks
3244
3287
# Example (to disable some checks): [ "all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022" ]
3245
3288
# Default: ["*"]
@@ -3409,8 +3452,7 @@ linters-settings:
3409
3452
# Overrides the default/root configuration.
3410
3453
# Default: []
3411
3454
overrides :
3412
- -
3413
- # The package path (uses `/` only as a separator).
3455
+ - # The package path (uses `/` only as a separator).
3414
3456
# Required
3415
3457
pkg : foo/bar
3416
3458
# Default: empty or the same as the default/root configuration.
@@ -3834,12 +3876,12 @@ linters-settings:
3834
3876
3835
3877
# A list of call idents that everything can be cuddled with.
3836
3878
# Defaults: [ "Lock", "RLock" ]
3837
- allow-cuddle-with-calls : [ "Foo", "Bar" ]
3879
+ allow-cuddle-with-calls : ["Foo", "Bar"]
3838
3880
3839
3881
# AllowCuddleWithRHS is a list of right hand side variables that is allowed
3840
3882
# to be cuddled with anything.
3841
3883
# Defaults: [ "Unlock", "RUnlock" ]
3842
- allow-cuddle-with-rhs : [ "Foo", "Bar" ]
3884
+ allow-cuddle-with-rhs : ["Foo", "Bar"]
3843
3885
3844
3886
# Causes an error when an If statement that checks an error variable doesn't
3845
3887
# cuddle with the assignment of that variable.
@@ -3850,7 +3892,7 @@ linters-settings:
3850
3892
# When force-err-cuddling is enabled this is a list of names
3851
3893
# used for error variables to check for in the conditional.
3852
3894
# Default: [ "err" ]
3853
- error-variable-names : [ "foo" ]
3895
+ error-variable-names : ["foo"]
3854
3896
3855
3897
# Causes an error if a short declaration (:=) cuddles with anything other than
3856
3898
# another short declaration.
@@ -3883,7 +3925,6 @@ linters-settings:
3883
3925
settings :
3884
3926
foo : bar
3885
3927
3886
-
3887
3928
issues :
3888
3929
# List of regexps of issue texts to exclude.
3889
3930
#
@@ -4034,7 +4075,6 @@ issues:
4034
4075
# Default: false
4035
4076
fix : true
4036
4077
4037
-
4038
4078
# output configuration options
4039
4079
output :
4040
4080
# The formats used to render issues.
@@ -4108,7 +4148,6 @@ output:
4108
4148
# Default: false
4109
4149
show-stats : true
4110
4150
4111
-
4112
4151
# Options for analysis running.
4113
4152
run :
4114
4153
# Timeout for analysis, e.g. 30s, 5m.
@@ -4155,14 +4194,13 @@ run:
4155
4194
# Define the Go version limit.
4156
4195
# Mainly related to generics support since go1.18.
4157
4196
# Default: use Go version from the go.mod file, fallback on the env var `GOVERSION`, fallback on 1.17
4158
- go : ' 1.19'
4197
+ go : " 1.19"
4159
4198
4160
4199
# Number of operating system threads (`GOMAXPROCS`) that can execute golangci-lint simultaneously.
4161
4200
# If it is explicitly set to 0 (i.e. not the default) then golangci-lint will automatically set the value to match Linux container CPU quota.
4162
4201
# Default: the number of logical CPUs in the machine
4163
4202
concurrency : 4
4164
4203
4165
-
4166
4204
severity :
4167
4205
# Set the default severity for issues.
4168
4206
#
0 commit comments