Skip to content
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

build(deps): bump github.com/go-critic/go-critic from 0.9.0 to 0.10.0 #4249

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@ issues:
- path: test/(fix|linters)_test.go
text: "string `gocritic.go` has 3 occurrences, make it a constant"

# Due to a change inside go-critic v0.10.0, some reports have been removed,
# but as we run analysis with the previous version of golangci-lint this leads to a paradoxical situation.
# This exclusion will be removed when the next version of golangci-lint (v1.56.0) will be released.
- path: pkg/golinters/nolintlint/nolintlint.go
text: "hugeParam: (i|b) is heavy \\(\\d+ bytes\\); consider passing it by pointer"

run:
timeout: 5m
skip-dirs:
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.9.0
github.com/go-critic/go-critic v0.10.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.

14 changes: 0 additions & 14 deletions pkg/golinters/nolintlint/nolintlint.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ type BaseIssue struct {
replacement *result.Replacement
}

//nolint:gocritic // TODO must be change in the future.
func (b BaseIssue) Position() token.Position {
return b.position
}

//nolint:gocritic // TODO must be change in the future.
func (b BaseIssue) Replacement() *result.Replacement {
return b.replacement
}
Expand All @@ -33,75 +31,64 @@ type ExtraLeadingSpace struct {
BaseIssue
}

//nolint:gocritic // TODO must be change in the future.
func (i ExtraLeadingSpace) Details() string {
return fmt.Sprintf("directive `%s` should not have more than one leading space", i.fullDirective)
}

//nolint:gocritic // TODO must be change in the future.
func (i ExtraLeadingSpace) String() string { return toString(i) }

type NotMachine struct {
BaseIssue
}

//nolint:gocritic // TODO must be change in the future.
func (i NotMachine) Details() string {
expected := i.fullDirective[:2] + strings.TrimLeftFunc(i.fullDirective[2:], unicode.IsSpace)
return fmt.Sprintf("directive `%s` should be written without leading space as `%s`",
i.fullDirective, expected)
}

//nolint:gocritic // TODO must be change in the future.
func (i NotMachine) String() string { return toString(i) }

type NotSpecific struct {
BaseIssue
}

//nolint:gocritic // TODO must be change in the future.
func (i NotSpecific) Details() string {
return fmt.Sprintf("directive `%s` should mention specific linter such as `%s:my-linter`",
i.fullDirective, i.directiveWithOptionalLeadingSpace)
}

//nolint:gocritic // TODO must be change in the future.
func (i NotSpecific) String() string { return toString(i) }

type ParseError struct {
BaseIssue
}

//nolint:gocritic // TODO must be change in the future.
func (i ParseError) Details() string {
return fmt.Sprintf("directive `%s` should match `%s[:<comma-separated-linters>] [// <explanation>]`",
i.fullDirective,
i.directiveWithOptionalLeadingSpace)
}

//nolint:gocritic // TODO must be change in the future.
func (i ParseError) String() string { return toString(i) }

type NoExplanation struct {
BaseIssue
fullDirectiveWithoutExplanation string
}

//nolint:gocritic // TODO must be change in the future.
func (i NoExplanation) Details() string {
return fmt.Sprintf("directive `%s` should provide explanation such as `%s // this is why`",
i.fullDirective, i.fullDirectiveWithoutExplanation)
}

//nolint:gocritic // TODO must be change in the future.
func (i NoExplanation) String() string { return toString(i) }

type UnusedCandidate struct {
BaseIssue
ExpectedLinter string
}

//nolint:gocritic // TODO must be change in the future.
func (i UnusedCandidate) Details() string {
details := fmt.Sprintf("directive `%s` is unused", i.fullDirective)
if i.ExpectedLinter != "" {
Expand All @@ -110,7 +97,6 @@ func (i UnusedCandidate) Details() string {
return details
}

//nolint:gocritic // TODO must be change in the future.
func (i UnusedCandidate) String() string { return toString(i) }

func toString(i Issue) string {
Expand Down
Loading