-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
New Feature: support nolint range #2007
Conversation
Hello, I'm not sure about the syntax with a hyphen. Maybe I'm also not sure that discuss that in a PR is a good idea. 🤔 |
2c1be42
to
0f8df04
Compare
Hi
Yes, I also considered the syntax you mentioned.
Yeah, If there are some problems with this syntax or other ideas about it, discuss it in the issue 👍 |
b6ae874
to
86ad4d9
Compare
Is this really needed, this can be solved with an anonymous block. package main
import "fmt"
func main() {
//nolint:forbidigo // Let's OK them here
{
fmt.Println("x")
fmt.Println("x")
fmt.Println("x")
}
// Not here.
fmt.Println("x")
} $ golangci-lint run --no-config --disable-all --enable forbidigo
main.go:14:2: use of `fmt.Println` forbidden by pattern `^fmt\.Print(|f|ln)$` (forbidigo)
fmt.Println("x")
^ |
86ad4d9
to
7bda5d6
Compare
Sorry, I forget to answer. My main concern with that related to #1658 |
As you know, example1:
example2:
As the other case, users can't do nolint across multiple functions or scope. |
Hmm, I didn't know about that issue, thanks. I think there are several actions that can be taken here, and I'd like to hear your opinions..
|
My opinion:
|
I agree with you. |
I will close the PR and keep issue #129 to track the topic. |
Hi team :D
Fixes #129
Support the new feature nolint range.
Now, we can ignore reports with
nolint-begin
andnolint-end
I've opened it early to hear any feedback on the syntax. I'll open it as a formal PR once I've written some tests and can get everyone to agree on the above syntax.