Skip to content

Commit 82147d5

Browse files
bombsimonldez
andauthored
build(deps): bump github.com/bombsimon/wsl/v5 from 4.7.0 to 5.0.0 (#5900)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
1 parent 6d9ab42 commit 82147d5

21 files changed

+601
-94
lines changed

.golangci.next.reference.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ linters:
126126
- whitespace
127127
- wrapcheck
128128
- wsl
129+
- wsl_v5
129130
- zerologlint
130131

131132
# Disable specific linters.
@@ -236,6 +237,7 @@ linters:
236237
- whitespace
237238
- wrapcheck
238239
- wsl
240+
- wsl_v5
239241
- zerologlint
240242

241243
# All available settings of specific linters.
@@ -3912,6 +3914,93 @@ linters:
39123914
# Default: false
39133915
force-short-decl-cuddling: true
39143916

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+
39154004
# The custom section can be used to define linter plugins to be loaded at runtime.
39164005
# See README documentation for more info.
39174006
custom:

.golangci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,12 @@ linters:
187187
linters:
188188
- dupl
189189

190+
# Deprecated linters
191+
- path: pkg/lint/lintersdb/builder_linter.go
192+
text: "SA1019: wsl.NewV4 is deprecated: use NewV5 instead."
193+
linters:
194+
- staticcheck
195+
190196
formatters:
191197
enable:
192198
- gofmt

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ require (
2626
github.com/bkielbasa/cyclop v1.2.3
2727
github.com/blizzy78/varnamelen v0.8.0
2828
github.com/bombsimon/wsl/v4 v4.7.0
29+
github.com/bombsimon/wsl/v5 v5.0.0
2930
github.com/breml/bidichk v0.3.3
3031
github.com/breml/errchkjson v0.4.1
3132
github.com/butuzov/ireturn v0.4.0

go.sum

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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
},

pkg/commands/internal/migrate/migrate_linters_settings.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -998,8 +998,8 @@ func toWrapcheckSettings(old versionone.WrapcheckSettings) versiontwo.WrapcheckS
998998
}
999999
}
10001000

1001-
func toWSLSettings(old versionone.WSLSettings) versiontwo.WSLSettings {
1002-
return versiontwo.WSLSettings{
1001+
func toWSLSettings(old versionone.WSLSettings) versiontwo.WSLv4Settings {
1002+
return versiontwo.WSLv4Settings{
10031003
StrictAppend: old.StrictAppend,
10041004
AllowAssignAndCallCuddle: old.AllowAssignAndCallCuddle,
10051005
AllowAssignAndAnythingCuddle: old.AllowAssignAndAnythingCuddle,

0 commit comments

Comments
 (0)