Skip to content

Commit

Permalink
build(deps): bump github.com/go-critic/go-critic from 0.10.0 to 0.11.0 (
Browse files Browse the repository at this point in the history
#4295)

Co-authored-by: Fernandez Ludovic <[email protected]>
  • Loading branch information
dependabot[bot] and ldez committed Jan 2, 2024
1 parent 8f4b1a7 commit 87d55d9
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
10 changes: 9 additions & 1 deletion .golangci.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,10 @@ linters-settings:
# Whether to restrict checker to params only.
# Default: true
paramsOnly: false
commentedOutCode:
# Min length of the comment that triggers a warning.
# Default: 15
minLength: 50
elseif:
# Whether to skip balanced if-else pairs.
# Default: true
Expand All @@ -573,6 +577,10 @@ linters-settings:
# Size in bytes that makes the warning trigger.
# Default: 80
sizeThreshold: 70
ifElseChain:
# Min number of if-else blocks that makes the warning trigger.
# Default: 2
minThreshold: 4
nestingReduce:
# Min number of statements inside a branch to trigger a warning.
# Default: 5
Expand Down Expand Up @@ -602,7 +610,7 @@ linters-settings:
# Then:
# ruleguard prints the specific Where() condition that was rejected.
#
# The flag is passed to the ruleguard 'debug-group' argument.
# The option is passed to the ruleguard 'debug-group' argument.
# Default: ""
debug: 'emptyDecl'
# Deprecated, use 'failOn' param.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ require (
github.com/firefart/nonamedreturns v1.0.4
github.com/fzipp/gocyclo v0.6.0
github.com/ghostiam/protogetter v0.3.3
github.com/go-critic/go-critic v0.10.0
github.com/go-critic/go-critic v0.11.0
github.com/go-xmlfmt/xmlfmt v1.1.2
github.com/gofrs/flock v0.8.1
github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2
Expand Down
4 changes: 2 additions & 2 deletions go.sum

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

2 changes: 1 addition & 1 deletion pkg/golinters/mirror.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func NewMirror() *goanalysis.Linter {
Pos: i.Start,
}

if len(i.InlineFix) > 0 {
if i.InlineFix != "" {
issue.Replacement = &result.Replacement{
Inline: &result.InlineFix{
StartCol: i.Start.Column - 1,
Expand Down
6 changes: 3 additions & 3 deletions pkg/golinters/nolintlint/nolintlint.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func (l Linter) Run(fset *token.FileSet, nodes ...ast.Node) ([]Issue, error) {
}

directiveWithOptionalLeadingSpace := "//"
if len(leadingSpace) > 0 {
if leadingSpace != "" {
directiveWithOptionalLeadingSpace += " "
}

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

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

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

0 comments on commit 87d55d9

Please sign in to comment.