Skip to content

build(deps): bump github.com/bombsimon/wsl/v5 from 4.7.0 to 5.0.0 #5900

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Jun 28, 2025
Merged
89 changes: 89 additions & 0 deletions .golangci.next.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ linters:
- whitespace
- wrapcheck
- wsl
- wsl_v5
- zerologlint

# Disable specific linters.
Expand Down Expand Up @@ -236,6 +237,7 @@ linters:
- whitespace
- wrapcheck
- wsl
- wsl_v5
- zerologlint

# All available settings of specific linters.
Expand Down Expand Up @@ -3912,6 +3914,93 @@ linters:
# Default: false
force-short-decl-cuddling: true

wsl_v5:
# Allow cuddling a variable if it's used first in the immediate following block,
# even if the statement with the block doesn't use the variable.
# https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#configuration
# Default: true
allow-first-in-block: false

# Same as above,
# but allows cuddling if the variable is used anywhere in the following (or nested) block.
# https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#configuration
# Default: false
allow-whole-block: true

# If a block contains more than this number of lines,
# the branch statement needs to be separated by whitespace.
# https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#configuration
# Default: 2
branch-max-lines: 4

# If set to a non-negative number,
# case blocks need to end with whitespace if exceeding this number
# https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#configuration
# Default: 0
case-max-lines: 2

# Default checks to use.
# Can be `all`, `none`, `default` or empty.
# https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#checks-and-configuration
# Default: ""
default: all

# Enabled checks.
# Will be additive to any presets.
# https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#checks-and-configuration
# Default: []
enable:
- assign
- branch
- decl
- defer
- expr
- for
- go
- if
- inc-dec
- label
- range
- return
- select
- send
- switch
- type-switch
- append
- assign-exclusive
- assign-expr
- err
- leading-whitespace
- trailing-whitespace

# Disable checks.
# Will be subtractive to any preset.
# https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#checks-and-configuration
# Default: []
disable:
- assign
- branch
- decl
- defer
- expr
- for
- go
- if
- inc-dec
- label
- range
- return
- select
- send
- switch
- type-switch
- append
- assign-exclusive
- assign-expr
- err
- leading-whitespace
- trailing-whitespace

# The custom section can be used to define linter plugins to be loaded at runtime.
# See README documentation for more info.
custom:
Expand Down
6 changes: 6 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@ linters:
linters:
- dupl

# Deprecated linters
- path: pkg/lint/lintersdb/builder_linter.go
text: "SA1019: wsl.NewV4 is deprecated: use NewV5 instead."
linters:
- staticcheck

formatters:
enable:
- gofmt
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ require (
github.com/bkielbasa/cyclop v1.2.3
github.com/blizzy78/varnamelen v0.8.0
github.com/bombsimon/wsl/v4 v4.7.0
github.com/bombsimon/wsl/v5 v5.0.0
github.com/breml/bidichk v0.3.3
github.com/breml/errchkjson v0.4.1
github.com/butuzov/ireturn v0.4.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

68 changes: 68 additions & 0 deletions jsonschema/golangci.next.jsonschema.json
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,32 @@
"header"
]
},
"wsl-checks": {
"enum": [
"assign",
"branch",
"decl",
"defer",
"expr",
"for",
"go",
"if",
"inc-dec",
"label",
"range",
"return",
"select",
"send",
"switch",
"type-switch",
"append",
"assign-exclusive",
"assign-expr",
"err",
"leading-whitespace",
"trailing-whitespace"
]
},
"relative-path-modes": {
"enum": [
"gomod",
Expand Down Expand Up @@ -829,6 +855,7 @@
"whitespace",
"wrapcheck",
"wsl",
"wsl_v5",
"zerologlint"
]
},
Expand Down Expand Up @@ -4090,6 +4117,44 @@
}
}
},
"wslSettingsV5": {
"type": "object",
"additionalProperties": false,
"properties": {
"allow-first-in-block": {
"type": "boolean",
"default": true
},
"allow-whole-block": {
"type": "boolean",
"default": false
},
"branch-max-lines": {
"type": "integer",
"default": 2
},
"case-max-lines": {
"type": "integer",
"default": 0
},
"default": {
"enum": ["all", "none", "default", ""],
"default": "default"
},
"enable": {
"type": "array",
"items": {
"$ref": "#/definitions/wsl-checks"
}
},
"disable": {
"type": "array",
"items": {
"$ref": "#/definitions/wsl-checks"
}
}
}
},
"copyloopvarSettings": {
"type": "object",
"additionalProperties": false,
Expand Down Expand Up @@ -4592,6 +4657,9 @@
"wsl": {
"$ref": "#/definitions/settings/definitions/wslSettings"
},
"wsl_v5": {
"$ref": "#/definitions/settings/definitions/wslSettingsV5"
},
"copyloopvar": {
"$ref": "#/definitions/settings/definitions/copyloopvarSettings"
},
Expand Down
4 changes: 2 additions & 2 deletions pkg/commands/internal/migrate/migrate_linters_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -998,8 +998,8 @@ func toWrapcheckSettings(old versionone.WrapcheckSettings) versiontwo.WrapcheckS
}
}

func toWSLSettings(old versionone.WSLSettings) versiontwo.WSLSettings {
return versiontwo.WSLSettings{
func toWSLSettings(old versionone.WSLSettings) versiontwo.WSLv4Settings {
return versiontwo.WSLv4Settings{
StrictAppend: old.StrictAppend,
AllowAssignAndCallCuddle: old.AllowAssignAndCallCuddle,
AllowAssignAndAnythingCuddle: old.AllowAssignAndAnythingCuddle,
Expand Down
Loading
Loading