Skip to content

Commit d6bcf9f

Browse files
authored
Update wsl to 3.3.0, sort config in example config (#1922)
* Update wsl to 3.3.0, sort config in example config * chore: ignore CVE-2020-26160
1 parent 9cb902c commit d6bcf9f

File tree

6 files changed

+18
-16
lines changed

6 files changed

+18
-16
lines changed

.golangci.example.yml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -518,26 +518,19 @@ linters-settings:
518518
multi-func: false # Enforces newlines (or comments) after every multi-line function signature
519519

520520
wsl:
521-
# If true append is only allowed to be cuddled if appending value is
522-
# matching variables, fields or types on line above. Default is true.
523-
strict-append: true
524-
# Allow calls and assignments to be cuddled as long as the lines have any
525-
# matching variables, fields or types. Default is true.
526-
allow-assign-and-call: true
527-
# Allow assignments to be cuddled with anything. Default is false.
521+
# See https://github.com/bombsimon/wsl/blob/master/doc/configuration.md for
522+
# documentation of available settings. These are the defaults for
523+
# `golangci-lint`.
528524
allow-assign-and-anything: false
529-
# Allow multiline assignments to be cuddled. Default is true.
530-
allow-multiline-assign: true
531-
# Allow declarations (var) to be cuddled.
525+
allow-assign-and-call: true
532526
allow-cuddle-declarations: false
533-
# Allow trailing comments in ending of blocks
527+
allow-multiline-assign: true
528+
allow-separated-leading-comment: false
534529
allow-trailing-comment: false
535-
# Force newlines in end of case at this limit (0 = never).
536530
force-case-trailing-whitespace: 0
537-
# Force cuddling of err checks with err var assignment
538531
force-err-cuddling: false
539-
# Allow leading comments to be separated with empty lines
540-
allow-separated-leading-comment: false
532+
force-short-decl-cuddling: false
533+
strict-append: true
541534

542535
# The custom section can be used to define linter plugins to be loaded at runtime. See README doc
543536
# for more info.

.nancy-ignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ CVE-2020-15136
55

66
# Skip for indirect dependency github.com/gogo/[email protected]
77
CVE-2021-3121
8+
9+
# Skip for indirect dependency github.com/dgrijalva/[email protected]
10+
CVE-2020-26160

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/ashanbrown/forbidigo v1.1.0
1212
github.com/ashanbrown/makezero v0.0.0-20210308000810-4155955488a0
1313
github.com/bkielbasa/cyclop v1.2.0
14-
github.com/bombsimon/wsl/v3 v3.2.0
14+
github.com/bombsimon/wsl/v3 v3.3.0
1515
github.com/charithe/durationcheck v0.0.6
1616
github.com/daixiang0/gci v0.2.8
1717
github.com/denis-tingajkin/go-header v0.4.2

go.sum

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

pkg/config/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@ type WSLSettings struct {
360360
AllowTrailingComment bool `mapstructure:"allow-trailing-comment"`
361361
AllowSeparatedLeadingComment bool `mapstructure:"allow-separated-leading-comment"`
362362
ForceCuddleErrCheckAndAssign bool `mapstructure:"force-err-cuddling"`
363+
ForceExclusiveShortDeclarations bool `mapstructure:"force-short-decl-cuddling"`
363364
ForceCaseTrailingWhitespaceLimit int `mapstructure:"force-case-trailing-whitespace"`
364365
}
365366

@@ -523,6 +524,7 @@ var defaultLintersSettings = LintersSettings{
523524
AllowTrailingComment: false,
524525
AllowSeparatedLeadingComment: false,
525526
ForceCuddleErrCheckAndAssign: false,
527+
ForceExclusiveShortDeclarations: false,
526528
ForceCaseTrailingWhitespaceLimit: 0,
527529
},
528530
NoLintLint: NoLintLintSettings{

pkg/golinters/wsl.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ func NewWSL() *goanalysis.Linter {
4646
AllowSeparatedLeadingComment: linterCfg.AllowSeparatedLeadingComment,
4747
ForceCuddleErrCheckAndAssign: linterCfg.ForceCuddleErrCheckAndAssign,
4848
ForceCaseTrailingWhitespaceLimit: linterCfg.ForceCaseTrailingWhitespaceLimit,
49+
ForceExclusiveShortDeclarations: linterCfg.ForceExclusiveShortDeclarations,
4950
AllowCuddleWithCalls: []string{"Lock", "RLock"},
5051
AllowCuddleWithRHS: []string{"Unlock", "RUnlock"},
5152
ErrorVariableNames: []string{"err"},

0 commit comments

Comments
 (0)