-
-
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
Add new linter: npecheck #3969
Add new linter: npecheck #3969
Conversation
Check potential null pointer reference exceptions, the most perfect check on the whole network.
In order for a pull request adding a linter to be reviewed, the linter and the PR must follow some requirements.
Pull Request Description
Linter
The Linter Tests Inside Golangci-lint
|
1. Use linter repository 2. Add test case
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
The requirements defined in the checklist are still not met. |
There are many false positives (99,999999%). By design, this linter can not meet our requirement for false positives. |
In fact, it should not be understood this way. This npecheck linter is also not enabled by default, and users can decide whether to turn it on or not for themselves. Currently, this linter is already can be used as a plugin in the IDE, in our private projects.
In fact, many people need this npecheck's linter function. Why not give that choice to the user?
Only a simple configuration is required, such as the following:
…------------------ 原始邮件 ------------------
发件人: "golangci/golangci-lint" ***@***.***>;
发送时间: 2023年7月23日(星期天) 晚上9:20
***@***.***>;
***@***.******@***.***>;
主题: Re: [golangci/golangci-lint] Add new linter: npecheck (PR #3969)
There are many false positives (99,999999%).
The use of a pointer doesn't mean there is an NPE.
By design, this linter can not meet our requirement for false positives.
I would recommend that you create a plugin.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
The problem is not how I understand this linter, but how you understand what is a linter.
This sentence is partially wrong because all the linters are enabled when using
Because your analyzer detects "potential" NPE. The majority of the reports are not NPE (false positives).
I think you have forgotten to add the configuration but it's not important because your analyzer is just offtopic. |
What project need to enable-all linters ? From the many projects I've worked on, almost none of them are enable-all. With enable-all, the project is dead.
Why do you always consider most scenarios? Why aren't we allowed to take a small part of the situation.
…------------------ 原始邮件 ------------------
发件人: "golangci/golangci-lint" ***@***.***>;
发送时间: 2023年7月23日(星期天) 晚上11:10
***@***.***>;
***@***.******@***.***>;
主题: Re: [golangci/golangci-lint] Add new linter: npecheck (PR #3969)
In fact, it should not be understood this way.
The problem is not how I understand this linter, but how you understand what is a linter.
This npecheck linter is also not enabled by default
This sentence is partially wrong because all the linters are enabled when using enable-all.
In fact, many people need this npecheck's linter function. Why not give that choice to the user?
Because your analyzer detects "potential" NPE, the majority of the reports are false positives.
Your analyzer is not a linter but a pointer detector.
Only a simple configuration is required, such as the following:
I think you have forgotten to add the configuration.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
And this small part of the situation may be the most central thing for some business scenarios.
…------------------ 原始邮件 ------------------
发件人: "flyman" ***@***.***>;
发送时间: 2023年7月23日(星期天) 晚上11:17
***@***.******@***.***>;
***@***.***>;
主题: 回复: [golangci/golangci-lint] Add new linter: npecheck (PR #3969)
What project need to enable-all linters ? From the many projects I've worked on, almost none of them are enable-all. With enable-all, the project is dead.
Why do you always consider most scenarios? Why aren't we allowed to take a small part of the situation.
------------------ 原始邮件 ------------------
发件人: "golangci/golangci-lint" ***@***.***>;
发送时间: 2023年7月23日(星期天) 晚上11:10
***@***.***>;
***@***.******@***.***>;
主题: Re: [golangci/golangci-lint] Add new linter: npecheck (PR #3969)
In fact, it should not be understood this way.
The problem is not how I understand this linter, but how you understand what is a linter.
This npecheck linter is also not enabled by default
This sentence is partially wrong because all the linters are enabled when using enable-all.
In fact, many people need this npecheck's linter function. Why not give that choice to the user?
Because your analyzer detects "potential" NPE, the majority of the reports are false positives.
Your analyzer is not a linter but a pointer detector.
Only a simple configuration is required, such as the following:
I think you have forgotten to add the configuration.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
I use
I don't understand your sentences. |
Why your projects need to enable-all ? What is your purpose? Test each linter? Or test your code ?
As an open source project, I think you should look at how other users are using it. And not how you use it.
No further progress can be made if it is only for the convenience of your own projects.
…------------------ 原始邮件 ------------------
发件人: "golangci/golangci-lint" ***@***.***>;
发送时间: 2023年7月23日(星期天) 晚上11:25
***@***.***>;
***@***.******@***.***>;
主题: Re: [golangci/golangci-lint] Add new linter: npecheck (PR #3969)
With enable-all, the project is dead.
I use enable-all on ALL my projects, so all my projects are dead?
Why do you always consider most scenarios? Why aren't we allowed to take a small part of the situation.
And this small part of the situation may be the most central thing for some business scenarios.
I don't understand your sentences.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
I think my explanations are clear: your analyzer is not an NPE linter but a pointer detector, which leads to a majority of useless reports (false positives). Feel free to not agree but my decision is based on our organization's criteria defined by a team (and not just me as you suggest), they are the same criteria for all linters. So now I will stop answering because this is a waste of time for you and me. |
Well. Let me also fill you in on the background of our linter. There is a development, add a line of debug logs, the result of the null pointer reference panic, resulting in interface unavailable. It's hard to control these things with manual code review. It is also difficult to write a UT that deliberately covers all use cases, so the npecheck linter is useful in some strict scenarios.
…------------------ 原始邮件 ------------------
发件人: "golangci/golangci-lint" ***@***.***>;
发送时间: 2023年7月23日(星期天) 晚上11:33
***@***.***>;
***@***.******@***.***>;
主题: Re: [golangci/golangci-lint] Add new linter: npecheck (PR #3969)
I think my explanations are clear: your analyzer is not a linter but a pointer detector, which leads to a majority of useless reports (false positives).
Based on that your analyzer cannot be a part of golangci-lint.
Feel free to not agree but my decision is based on our organization's criteria, they are the same criteria for all linters.
So now I will stop answering because this is a waste of time for you and me.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Check for potential nil pointer reference exceptions to compensate for go linter's shortcomings in this area. This linter is supposed to be the most rigorous and complete NPE solution.
1. linter repository
https://github.com/chenfeining/go-npecheck
2. description