Skip to content

Commit bb4d6b7

Browse files
dependabot[bot]bombsimonldez
authored
build(deps): bump github.com/bombsimon/wsl/v4 from 4.5.0 to 4.6.0 (#5483)
Co-authored-by: Simon Sawert <[email protected]> Co-authored-by: Fernandez Ludovic <[email protected]>
1 parent 0aeae0e commit bb4d6b7

File tree

8 files changed

+23
-3
lines changed

8 files changed

+23
-3
lines changed

.golangci.next.reference.yml

+6
Original file line numberDiff line numberDiff line change
@@ -3788,6 +3788,12 @@ linters:
37883788
# Defaults: [ "Unlock", "RUnlock" ]
37893789
allow-cuddle-with-rhs: [ "Foo", "Bar" ]
37903790

3791+
# Allow cuddling with any block as long as the variable is used somewhere in
3792+
# the block.
3793+
# https://github.com/bombsimon/wsl/blob/HEAD/doc/configuration.md#allow-cuddle-used-in-block
3794+
# Default: false
3795+
allow-cuddle-used-in-block: true
3796+
37913797
# Causes an error when an If statement that checks an error variable doesn't
37923798
# cuddle with the assignment of that variable.
37933799
# https://github.com/bombsimon/wsl/blob/HEAD/doc/configuration.md#force-err-cuddling

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ require (
2424
github.com/ashanbrown/makezero v1.2.0
2525
github.com/bkielbasa/cyclop v1.2.3
2626
github.com/blizzy78/varnamelen v0.8.0
27-
github.com/bombsimon/wsl/v4 v4.5.0
27+
github.com/bombsimon/wsl/v4 v4.6.0
2828
github.com/breml/bidichk v0.3.2
2929
github.com/breml/errchkjson v0.4.0
3030
github.com/butuzov/ireturn v0.3.1

go.sum

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jsonschema/golangci.jsonschema.json

+5
Original file line numberDiff line numberDiff line change
@@ -3954,6 +3954,11 @@
39543954
"type": "string"
39553955
}
39563956
},
3957+
"allow-cuddle-used-in-block": {
3958+
"description": "Allow cuddling with any block as long as the variable is used somewhere in the block",
3959+
"type": "boolean",
3960+
"default": false
3961+
},
39573962
"allow-multiline-assign": {
39583963
"description": "Allow multiline assignments to be cuddled.",
39593964
"type": "boolean",

jsonschema/golangci.next.jsonschema.json

+5
Original file line numberDiff line numberDiff line change
@@ -3954,6 +3954,11 @@
39543954
"type": "string"
39553955
}
39563956
},
3957+
"allow-cuddle-used-in-block": {
3958+
"description": "Allow cuddling with any block as long as the variable is used somewhere in the block",
3959+
"type": "boolean",
3960+
"default": false
3961+
},
39573962
"allow-multiline-assign": {
39583963
"description": "Allow multiline assignments to be cuddled.",
39593964
"type": "boolean",

pkg/commands/internal/migrate/versiontwo/linters_settings.go

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/config/linters_settings.go

+2
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ var defaultLintersSettings = LintersSettings{
188188
AllowCuddleDeclaration: false,
189189
AllowCuddleWithCalls: []string{"Lock", "RLock"},
190190
AllowCuddleWithRHS: []string{"Unlock", "RUnlock"},
191+
AllowCuddleUsedInBlock: false,
191192
ForceCuddleErrCheckAndAssign: false,
192193
ErrorVariableNames: []string{"err"},
193194
ForceExclusiveShortDeclarations: false,
@@ -972,6 +973,7 @@ type WSLSettings struct {
972973
AllowCuddleDeclaration bool `mapstructure:"allow-cuddle-declarations"`
973974
AllowCuddleWithCalls []string `mapstructure:"allow-cuddle-with-calls"`
974975
AllowCuddleWithRHS []string `mapstructure:"allow-cuddle-with-rhs"`
976+
AllowCuddleUsedInBlock bool `mapstructure:"allow-cuddle-used-in-block"`
975977
ForceCuddleErrCheckAndAssign bool `mapstructure:"force-err-cuddling"`
976978
ErrorVariableNames []string `mapstructure:"error-variable-names"`
977979
ForceExclusiveShortDeclarations bool `mapstructure:"force-short-decl-cuddling"`

pkg/golinters/wsl/wsl.go

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ func New(settings *config.WSLSettings) *goanalysis.Linter {
2323
AllowCuddleWithCalls: settings.AllowCuddleWithCalls,
2424
AllowCuddleWithRHS: settings.AllowCuddleWithRHS,
2525
ForceCuddleErrCheckAndAssign: settings.ForceCuddleErrCheckAndAssign,
26+
AllowCuddleUsedInBlock: settings.AllowCuddleUsedInBlock,
2627
ErrorVariableNames: settings.ErrorVariableNames,
2728
ForceExclusiveShortDeclarations: settings.ForceExclusiveShortDeclarations,
2829
IncludeGenerated: true, // force to true because golangci-lint already have a way to filter generated files.

0 commit comments

Comments
 (0)