Skip to content

Commit 03bb402

Browse files
committed
chore: configuration and jsonschema
1 parent 307489b commit 03bb402

File tree

2 files changed

+118
-18
lines changed

2 files changed

+118
-18
lines changed

.golangci.next.reference.yml

Lines changed: 50 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3915,39 +3915,45 @@ linters:
39153915
force-short-decl-cuddling: true
39163916

39173917
wsl_v5:
3918-
# Allow cuddling a variable if it's used first in the immediate following
3919-
# block, even if the statement with the block doesn't use the variable
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
39203921
# Default: true
3921-
allow-first-in-block: true
3922+
allow-first-in-block: false
39223923

3923-
# Same as above, but allows cuddling if the variable is used anywhere in
3924-
# the following (or nested) block
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
39253927
# Default: false
3926-
allow-whole-block: false
3928+
allow-whole-block: true
39273929

3928-
# If a block contains more than this number of lines the branch statement
3929-
# need to be separated by a whitespace
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
39303933
# Default: 2
3931-
branch-max-lines: 2
3934+
branch-max-lines: 4
39323935

3933-
# If set to a non negative number, case blocks needs to end with a
3934-
# whitespace if exceeding this number
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
39353939
# Default: 0
3936-
case-max-lines: 0
3940+
case-max-lines: 2
39373941

3938-
# Preset with checks. Can be `all`, `none`, `default` or empty
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
39393945
# Default: ""
3940-
default: ~
3946+
default: all
39413947

3942-
# Enabled checks. Will be additive to any preset.
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
39433951
# Default: None
39443952
enable:
3945-
- append
39463953
- assign
39473954
- branch
39483955
- decl
39493956
- defer
3950-
- err
39513957
- expr
39523958
- for
39533959
- go
@@ -3960,14 +3966,40 @@ linters:
39603966
- send
39613967
- switch
39623968
- type-switch
3969+
- append
3970+
- assign-exclusive
3971+
- assign-expr
3972+
- err
39633973
- leading-whitespace
39643974
- trailing-whitespace
39653975

3966-
# Disable checks. Will be subtractive to any preset.
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
39673979
# Default: None
39683980
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
39693998
- assign-exclusive
39703999
- assign-expr
4000+
- err
4001+
- leading-whitespace
4002+
- trailing-whitespace
39714003

39724004
# The custom section can be used to define linter plugins to be loaded at runtime.
39734005
# See README documentation for more info.

jsonschema/golangci.next.jsonschema.json

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,32 @@
685685
"header"
686686
]
687687
},
688+
"wsl-checks": {
689+
"enum": [
690+
"assign",
691+
"branch",
692+
"decl",
693+
"defer",
694+
"expr",
695+
"for",
696+
"go",
697+
"if",
698+
"inc-dec",
699+
"label",
700+
"range",
701+
"return",
702+
"select",
703+
"send",
704+
"switch",
705+
"type-switch",
706+
"append",
707+
"assign-exclusive",
708+
"assign-expr",
709+
"err",
710+
"leading-whitespace",
711+
"trailing-whitespace"
712+
]
713+
},
688714
"relative-path-modes": {
689715
"enum": [
690716
"gomod",
@@ -829,6 +855,7 @@
829855
"whitespace",
830856
"wrapcheck",
831857
"wsl",
858+
"wsl_v5",
832859
"zerologlint"
833860
]
834861
},
@@ -4090,6 +4117,44 @@
40904117
}
40914118
}
40924119
},
4120+
"wslSettingsV5": {
4121+
"type": "object",
4122+
"additionalProperties": false,
4123+
"properties": {
4124+
"allow-first-in-block": {
4125+
"type": "boolean",
4126+
"default": true
4127+
},
4128+
"allow-whole-block": {
4129+
"type": "boolean",
4130+
"default": false
4131+
},
4132+
"branch-max-lines": {
4133+
"type": "integer",
4134+
"default": 2
4135+
},
4136+
"case-max-lines": {
4137+
"type": "integer",
4138+
"default": 0
4139+
},
4140+
"default": {
4141+
"enum": ["all", "none", "default", ""],
4142+
"default": "default"
4143+
},
4144+
"enable": {
4145+
"type": "array",
4146+
"items": {
4147+
"$ref": "#/definitions/wsl-checks"
4148+
}
4149+
},
4150+
"disable": {
4151+
"type": "array",
4152+
"items": {
4153+
"$ref": "#/definitions/wsl-checks"
4154+
}
4155+
}
4156+
}
4157+
},
40934158
"copyloopvarSettings": {
40944159
"type": "object",
40954160
"additionalProperties": false,
@@ -4592,6 +4657,9 @@
45924657
"wsl": {
45934658
"$ref": "#/definitions/settings/definitions/wslSettings"
45944659
},
4660+
"wsl_v5": {
4661+
"$ref": "#/definitions/settings/definitions/wslSettingsV5"
4662+
},
45954663
"copyloopvar": {
45964664
"$ref": "#/definitions/settings/definitions/copyloopvarSettings"
45974665
},

0 commit comments

Comments
 (0)