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

nolintlint: the autofix is skipped when several unsed linters #1581

Closed
ldez opened this issue Dec 27, 2020 · 0 comments · Fixed by #1583
Closed

nolintlint: the autofix is skipped when several unsed linters #1581

ldez opened this issue Dec 27, 2020 · 0 comments · Fixed by #1583
Assignees
Labels
bug Something isn't working

Comments

@ldez
Copy link
Member

ldez commented Dec 27, 2020

Related to #1573

before the fix:

// wantedErrors parses expected errors from comments in a file.
// nolint:gocyclo,nakedret,whitespace
func wantedErrors(file, short string) (errs []wantedError) {

or

// wantedErrors parses expected errors from comments in a file.
// nolint:nakedret,gocyclo,whitespace
func wantedErrors(file, short string) (errs []wantedError) {

or

// wantedErrors parses expected errors from comments in a file.
// nolint:gocyclo,whitespace,nakedret
func wantedErrors(file, short string) (errs []wantedError) {

results:

WARN Line 163 has multiple intersecting issues: []result.Issue{result.Issue{FromLinter:"nolintlint", Text:"directive `// nolint:gocyclo,nakedret,whitespace` is unused for linter \"gocyclo\"", Severity:"", SourceLines:[]string{"// nolint:gocyclo,nakedret,whitespace"}, Replacement:(*result.Replacement)(0xc0074e3ec0), Pkg:(*packages.Package)(0xc0012b3b00), LineRange:(*result.Range)(nil), Pos:token.Position{Filename:"test/errchk.go", Offset:4489, Line:163, Column:1}, HunkPos:0, ExpectNoLint:true, ExpectedNoLintLinter:"gocyclo"}, result.Issue{FromLinter:"nolintlint", Text:"directive `// nolint:gocyclo,nakedret,whitespace` is unused for linter \"whitespace\"", Severity:"", SourceLines:[]string{"// nolint:gocyclo,nakedret,whitespace"}, Replacement:(*result.Replacement)(0xc0074e3f20), Pkg:(*packages.Package)(0xc0012b3b00), LineRange:(*result.Range)(nil), Pos:token.Position{Filename:"test/errchk.go", Offset:4489, Line:163, Column:1}, HunkPos:0, ExpectNoLint:true, ExpectedNoLintLinter:"whitespace"}} 

no fix applied.

KO

@ldez ldez added the bug Something isn't working label Dec 27, 2020
ashanbrown added a commit that referenced this issue Dec 27, 2020
…nolint statements (#1573)" (#1584)

This reverts commit aeb9830.

There are some cases that nolinter fixer wasn't handling properly or expectedly (#1579, #1580, #1581) so we'll fix those in a new attempt.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants