Skip to content

Commit 87d55d9

Browse files
build(deps): bump github.com/go-critic/go-critic from 0.10.0 to 0.11.0 (#4295)
Co-authored-by: Fernandez Ludovic <[email protected]>
1 parent 8f4b1a7 commit 87d55d9

File tree

5 files changed

+16
-8
lines changed

5 files changed

+16
-8
lines changed

.golangci.reference.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,10 @@ linters-settings:
565565
# Whether to restrict checker to params only.
566566
# Default: true
567567
paramsOnly: false
568+
commentedOutCode:
569+
# Min length of the comment that triggers a warning.
570+
# Default: 15
571+
minLength: 50
568572
elseif:
569573
# Whether to skip balanced if-else pairs.
570574
# Default: true
@@ -573,6 +577,10 @@ linters-settings:
573577
# Size in bytes that makes the warning trigger.
574578
# Default: 80
575579
sizeThreshold: 70
580+
ifElseChain:
581+
# Min number of if-else blocks that makes the warning trigger.
582+
# Default: 2
583+
minThreshold: 4
576584
nestingReduce:
577585
# Min number of statements inside a branch to trigger a warning.
578586
# Default: 5
@@ -602,7 +610,7 @@ linters-settings:
602610
# Then:
603611
# ruleguard prints the specific Where() condition that was rejected.
604612
#
605-
# The flag is passed to the ruleguard 'debug-group' argument.
613+
# The option is passed to the ruleguard 'debug-group' argument.
606614
# Default: ""
607615
debug: 'emptyDecl'
608616
# Deprecated, use 'failOn' param.

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ require (
3737
github.com/firefart/nonamedreturns v1.0.4
3838
github.com/fzipp/gocyclo v0.6.0
3939
github.com/ghostiam/protogetter v0.3.3
40-
github.com/go-critic/go-critic v0.10.0
40+
github.com/go-critic/go-critic v0.11.0
4141
github.com/go-xmlfmt/xmlfmt v1.1.2
4242
github.com/gofrs/flock v0.8.1
4343
github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2

go.sum

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

pkg/golinters/mirror.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func NewMirror() *goanalysis.Linter {
3939
Pos: i.Start,
4040
}
4141

42-
if len(i.InlineFix) > 0 {
42+
if i.InlineFix != "" {
4343
issue.Replacement = &result.Replacement{
4444
Inline: &result.InlineFix{
4545
StartCol: i.Start.Column - 1,

pkg/golinters/nolintlint/nolintlint.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ func (l Linter) Run(fset *token.FileSet, nodes ...ast.Node) ([]Issue, error) {
171171
}
172172

173173
directiveWithOptionalLeadingSpace := "//"
174-
if len(leadingSpace) > 0 {
174+
if leadingSpace != "" {
175175
directiveWithOptionalLeadingSpace += " "
176176
}
177177

@@ -188,7 +188,7 @@ func (l Linter) Run(fset *token.FileSet, nodes ...ast.Node) ([]Issue, error) {
188188
}
189189

190190
// check for, report and eliminate leading spaces, so we can check for other issues
191-
if len(leadingSpace) > 0 {
191+
if leadingSpace != "" {
192192
removeWhitespace := &result.Replacement{
193193
Inline: &result.InlineFix{
194194
StartCol: pos.Column + 1,
@@ -217,7 +217,7 @@ func (l Linter) Run(fset *token.FileSet, nodes ...ast.Node) ([]Issue, error) {
217217
lintersText, explanation := fullMatches[1], fullMatches[2]
218218

219219
var linters []string
220-
if len(lintersText) > 0 && !strings.HasPrefix(lintersText, "all") {
220+
if lintersText != "" && !strings.HasPrefix(lintersText, "all") {
221221
lls := strings.Split(lintersText, ",")
222222
linters = make([]string, 0, len(lls))
223223
rangeStart := (pos.Column - 1) + len("//") + len(leadingSpace) + len("nolint:")

0 commit comments

Comments
 (0)