Skip to content

Commit 8b60c84

Browse files
committed
add yaml language server config
1 parent 09489d5 commit 8b60c84

File tree

3 files changed

+195
-119
lines changed

3 files changed

+195
-119
lines changed

Diff for: .golangci.next.reference.yml

+94-56
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# yaml-language-server: $schema=https://golangci-lint.run/jsonschema/golangci.jsonschema.json
12
# This file contains all available configuration options
23
# with their default values (in comments).
34
#
@@ -276,7 +277,6 @@ linters:
276277
# Default: false
277278
fast: true
278279

279-
280280
# All available settings of specific linters.
281281
linters-settings:
282282
asasalint:
@@ -590,13 +590,13 @@ linters-settings:
590590
# If `custom-order` is `true`, it follows the order of `sections` option.
591591
# Default: ["standard", "default"]
592592
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.
595595
- 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.
600600

601601
# Checks that no inline Comments are present.
602602
# Default: false
@@ -710,7 +710,7 @@ linters-settings:
710710
ignore-calls: false
711711
# Exclude strings matching the given regular expression.
712712
# Default: ""
713-
ignore-strings: 'foo.+'
713+
ignore-strings: "foo.+"
714714

715715
gocritic:
716716
# Disable all checks.
@@ -1229,7 +1229,7 @@ linters-settings:
12291229
#
12301230
# The option is passed to the ruleguard 'debug-group' argument.
12311231
# Default: ""
1232-
debug: 'emptyDecl'
1232+
debug: "emptyDecl"
12331233
# Determines the behavior when an error occurs while parsing ruleguard files.
12341234
# If flag is not set, log error and skip rule files that contain an error.
12351235
# If flag is set, the value must be a comma-separated list of error conditions.
@@ -1243,7 +1243,7 @@ linters-settings:
12431243
# The special '${configDir}' variable is substituted with the absolute directory containing the golangci config file.
12441244
# Glob patterns such as 'rules-*.go' may be specified.
12451245
# Default: ""
1246-
rules: '${configDir}/ruleguard/rules-*.go,${configDir}/myrule1.go'
1246+
rules: "${configDir}/ruleguard/rules-*.go,${configDir}/myrule1.go"
12471247
# Comma-separated list of enabled groups or skip empty to enable everything.
12481248
# Tags can be defined with # character prefix.
12491249
# Default: "<all>"
@@ -1308,10 +1308,10 @@ linters-settings:
13081308
# https://pkg.go.dev/cmd/gofmt
13091309
# Default: []
13101310
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:]"
13151315

13161316
gofumpt:
13171317
# Module path which contains the source code being formatted.
@@ -1737,11 +1737,11 @@ linters-settings:
17371737
#
17381738
# Default: []
17391739
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"
17451745
# Ignore test files.
17461746
#
17471747
# Default: true
@@ -2089,9 +2089,9 @@ linters-settings:
20892089
# For example: https://github.com/timonwong/loggercheck/blob/7395ab86595781e33f7afba27ad7b55e6956ebcd/testdata/custom-rules.txt
20902090
# Default: empty
20912091
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
20952095

20962096
maintidx:
20972097
# Show functions with maintainability index lower than N.
@@ -2144,9 +2144,9 @@ linters-settings:
21442144
# Values always ignored: "1", "1.0", "0" and "0.0"
21452145
# Default: []
21462146
ignored-numbers:
2147-
- '0666'
2148-
- '0755'
2149-
- '42'
2147+
- "0666"
2148+
- "0755"
2149+
- "42"
21502150
# List of file patterns to exclude from analysis.
21512151
# Values always ignored: `.+_test.go`
21522152
# Default: []
@@ -2209,7 +2209,7 @@ linters-settings:
22092209
allow-unused: true
22102210
# Exclude following linters from requiring an explanation.
22112211
# Default: []
2212-
allow-no-explanation: [ ]
2212+
allow-no-explanation: []
22132213
# Enable to require an explanation of nonzero length after each nolint directive.
22142214
# Default: false
22152215
require-explanation: true
@@ -2295,7 +2295,6 @@ linters-settings:
22952295
# UnitAbbreviations detects abbreviated units in the metric name.
22962296
- UnitAbbreviations
22972297

2298-
22992298
protogetter:
23002299
# Skip files generated by specified generators from the checking.
23012300
# Checks only the file's initial comment, which must follow the format: "// Code generated by <generator-name>".
@@ -2380,7 +2379,7 @@ linters-settings:
23802379
severity: warning
23812380
disabled: false
23822381
exclude: [""]
2383-
arguments: [ 4 ]
2382+
arguments: [4]
23842383
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#atomic
23852384
- name: atomic
23862385
severity: warning
@@ -2391,7 +2390,7 @@ linters-settings:
23912390
severity: warning
23922391
disabled: false
23932392
exclude: [""]
2394-
arguments: [ "Ω","Σ","σ", "7" ]
2393+
arguments: ["Ω", "Σ", "σ", "7"]
23952394
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#bare-return
23962395
- name: bare-return
23972396
severity: warning
@@ -2417,7 +2416,7 @@ linters-settings:
24172416
severity: warning
24182417
disabled: false
24192418
exclude: [""]
2420-
arguments: [ 7 ]
2419+
arguments: [7]
24212420
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#comment-spacings
24222421
- name: comment-spacings
24232422
severity: warning
@@ -2431,7 +2430,7 @@ linters-settings:
24312430
severity: warning
24322431
disabled: false
24332432
exclude: [""]
2434-
arguments: [ 15 ]
2433+
arguments: [15]
24352434
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#confusing-naming
24362435
- name: confusing-naming
24372436
severity: warning
@@ -2464,7 +2463,7 @@ linters-settings:
24642463
severity: warning
24652464
disabled: false
24662465
exclude: [""]
2467-
arguments: [ 3 ]
2466+
arguments: [3]
24682467
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#datarace
24692468
- name: datarace
24702469
severity: warning
@@ -2481,13 +2480,13 @@ linters-settings:
24812480
disabled: false
24822481
exclude: [""]
24832482
arguments:
2484-
- [ "call-chain", "loop" ]
2483+
- ["call-chain", "loop"]
24852484
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#dot-imports
24862485
- name: dot-imports
24872486
severity: warning
24882487
disabled: false
24892488
exclude: [""]
2490-
arguments: [ ]
2489+
arguments: []
24912490
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#duplicated-imports
24922491
- name: duplicated-imports
24932492
severity: warning
@@ -2594,13 +2593,13 @@ linters-settings:
25942593
severity: warning
25952594
disabled: false
25962595
exclude: [""]
2597-
arguments: [ 10, 0 ]
2596+
arguments: [10, 0]
25982597
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#function-result-limit
25992598
- name: function-result-limit
26002599
severity: warning
26012600
disabled: false
26022601
exclude: [""]
2603-
arguments: [ 3 ]
2602+
arguments: [3]
26042603
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#get-return
26052604
- name: get-return
26062605
severity: warning
@@ -2653,19 +2652,19 @@ linters-settings:
26532652
severity: warning
26542653
disabled: false
26552654
exclude: [""]
2656-
arguments: [ 80 ]
2655+
arguments: [80]
26572656
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#max-control-nesting
26582657
- name: max-control-nesting
26592658
severity: warning
26602659
disabled: false
26612660
exclude: [""]
2662-
arguments: [ 3 ]
2661+
arguments: [3]
26632662
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#max-public-structs
26642663
- name: max-public-structs
26652664
severity: warning
26662665
disabled: false
26672666
exclude: [""]
2668-
arguments: [ 3 ]
2667+
arguments: [3]
26692668
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#modifies-parameter
26702669
- name: modifies-parameter
26712670
severity: warning
@@ -2729,10 +2728,10 @@ linters-settings:
27292728
disabled: false
27302729
exclude: [""]
27312730
arguments:
2732-
- - 'core.WriteError[1].Message'
2733-
- '/^([^A-Z]|$)/'
2731+
- - "core.WriteError[1].Message"
2732+
- "/^([^A-Z]|$)/"
27342733
- must not start with a capital letter
2735-
- - 'fmt.Errorf[0]'
2734+
- - "fmt.Errorf[0]"
27362735
- '/(^|[^\.!?])$/'
27372736
- must not end in punctuation
27382737
- - panic
@@ -2843,8 +2842,8 @@ linters-settings:
28432842
disabled: false
28442843
exclude: [""]
28452844
arguments:
2846-
- [ "ID" ] # AllowList
2847-
- [ "VM" ] # DenyList
2845+
- ["ID"] # AllowList
2846+
- ["VM"] # DenyList
28482847
- - upperCaseConst: true # Extra parameter (upperCaseConst|skipPackageNameChecks)
28492848
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#waitgroup-by-value
28502849
- name: waitgroup-by-value
@@ -3236,10 +3235,54 @@ linters-settings:
32363235
- fmt
32373236
# https://staticcheck.dev/docs/configuration/options/#initialisms
32383237
# 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+
]
32403283
# https://staticcheck.dev/docs/configuration/options/#http_status_code_whitelist
32413284
# Default: ["200", "400", "404", "500"]
3242-
http-status-code-whitelist: [ "200", "400", "404", "500" ]
3285+
http-status-code-whitelist: ["200", "400", "404", "500"]
32433286
# STxxxx checks in https://staticcheck.dev/docs/configuration/options/#checks
32443287
# Example (to disable some checks): [ "all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022" ]
32453288
# Default: ["*"]
@@ -3409,8 +3452,7 @@ linters-settings:
34093452
# Overrides the default/root configuration.
34103453
# Default: []
34113454
overrides:
3412-
-
3413-
# The package path (uses `/` only as a separator).
3455+
- # The package path (uses `/` only as a separator).
34143456
# Required
34153457
pkg: foo/bar
34163458
# Default: empty or the same as the default/root configuration.
@@ -3834,12 +3876,12 @@ linters-settings:
38343876

38353877
# A list of call idents that everything can be cuddled with.
38363878
# Defaults: [ "Lock", "RLock" ]
3837-
allow-cuddle-with-calls: [ "Foo", "Bar" ]
3879+
allow-cuddle-with-calls: ["Foo", "Bar"]
38383880

38393881
# AllowCuddleWithRHS is a list of right hand side variables that is allowed
38403882
# to be cuddled with anything.
38413883
# Defaults: [ "Unlock", "RUnlock" ]
3842-
allow-cuddle-with-rhs: [ "Foo", "Bar" ]
3884+
allow-cuddle-with-rhs: ["Foo", "Bar"]
38433885

38443886
# Causes an error when an If statement that checks an error variable doesn't
38453887
# cuddle with the assignment of that variable.
@@ -3850,7 +3892,7 @@ linters-settings:
38503892
# When force-err-cuddling is enabled this is a list of names
38513893
# used for error variables to check for in the conditional.
38523894
# Default: [ "err" ]
3853-
error-variable-names: [ "foo" ]
3895+
error-variable-names: ["foo"]
38543896

38553897
# Causes an error if a short declaration (:=) cuddles with anything other than
38563898
# another short declaration.
@@ -3883,7 +3925,6 @@ linters-settings:
38833925
settings:
38843926
foo: bar
38853927

3886-
38873928
issues:
38883929
# List of regexps of issue texts to exclude.
38893930
#
@@ -4034,7 +4075,6 @@ issues:
40344075
# Default: false
40354076
fix: true
40364077

4037-
40384078
# output configuration options
40394079
output:
40404080
# The formats used to render issues.
@@ -4108,7 +4148,6 @@ output:
41084148
# Default: false
41094149
show-stats: true
41104150

4111-
41124151
# Options for analysis running.
41134152
run:
41144153
# Timeout for analysis, e.g. 30s, 5m.
@@ -4155,14 +4194,13 @@ run:
41554194
# Define the Go version limit.
41564195
# Mainly related to generics support since go1.18.
41574196
# 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"
41594198

41604199
# Number of operating system threads (`GOMAXPROCS`) that can execute golangci-lint simultaneously.
41614200
# 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.
41624201
# Default: the number of logical CPUs in the machine
41634202
concurrency: 4
41644203

4165-
41664204
severity:
41674205
# Set the default severity for issues.
41684206
#

0 commit comments

Comments
 (0)