golangci-lint
golangci-lint copied to clipboard
Idea: support "nolint ranges"
Revive has the concept of begin/end blocks for nolinting. See here.
This could be useful under some circumstances.
I would like to see this implemented. My use-case: disable gocyclo for a specific exported method without exposing nolint:gocyclo in the godoc.
Stale bot went rampant. @jirfag please reopen.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
My use-case: disable gocyclo for a specific exported method without exposing nolint:gocyclo in the godoc.
That's still a problem.
@AlekSi is there a reason you're not able to do:
// Save provides a complex save method!
func Save() { // nolint:gocyclo
A better exemple coud be:
// Save provides a complex save method using third-party library with really long method names.
func Save() {
...
very long line of code //nolint:lll
...
another very long line of code //nolint:lll
...
one more //nolint:lll
...
}
@AlekSi I appreciate that other use cases exist, I was asking if my suggestion works for your specific challenge above.
I have just had the experience of ignore lll reports like @AlekSi mentioned, and I've been wanting this feature too.
Can I be the assignee for this Issue?
I'm thinking of doing ignore as follows.
func Save() {
//nolint-begin:lll
very long line of code
another very long line of code
one more
...
//nolint-end:lll
}
Please give your opinions on this idea. (And other opinions are also verrry welcome.)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.