Repository navigation
Add "nilaway" as a linter #4045
Description
Activity
Analyzers that just display potential problems are not considered as linters inside golangci-lint because of the large number of false positives.
Those kinds of analyzers are not allowed.Similar to #3969
Reacted by awoo- addedwaiting for: contributor feedbackRequires additional feedbackRequires additional feedback
on Aug 28, 2023 Ah, good to know. Maybe devs of that tool can optimize the code base to provide a linter interface.
Just curious to ask, why don't you provide a some kind of feature gate to allow "tools" and "false positives"? I totally understand your "golangci-lint's criteria". But maybe you can define "linter graduation policy": alpha > beta > stable, etc. So enabling experimental gates could allow non-stable and false-positive tools/linters.
I know, this would be a part of totally different proposal to discuss more about.
Reacted by Mateusz Urbanek, Ville Valkonen, G. Nithin Reddy and Anton GilgurMaybe devs of that tool can optimize the code base to provide a linter interface.
This is not the problem: the problem is false positives, not the linter interface.
Just curious to ask, why don't you provide a some kind of feature gate to allow "tools" and "false positives"? I totally understand your "golangci-lint's criteria". But maybe you can define "linter graduation policy": alpha > beta > stable, etc. So enabling experimental gates could allow non-stable and false-positive tools/linters.
The goal of golangci-lint is to be accurate and relevant, i.e. no false positives, this is why we have default exclusions.
False positives are no relation with a linter "state" (alpha > beta > stable or experimental).
So, for now, there is no possibility of "false-positive linter" or "potential issues detector".Reacted by Furkan Türkal, papazloynt, Olli Jarva, José Rojel, Mateusz Warzyński, Gergely Bräutigam, Aymeric Beaumet, Oleksandr Redko, Guntur Akhmad, Kyle Smith and 3 moreReacted by Yishai Berg, G. Nithin Reddy, Michael Freeman, Oleg Namaka, Alexandru Ungur, silverwind and Glenn Pratt- added and removedwaiting for: contributor feedbackRequires additional feedbackRequires additional feedbackenhancementNew feature or improvementNew feature or improvement
on Aug 28, 2023 I don't fully understand this policy, when golangci-lint has style linters which are all very "potential issue detectors" and have lot of "false positives", but, it's up to you I guess
Reacted by Andy Méry, Jon Williams, Pаramtamtām, Aymeric Beaumet, Jared Allard, Yishai Berg, Kortivex, Valentin Mezev, Amir Roshanaei, sattellite and 25 more@karelbilek
nilawayis still quite young and has really too many false positives. Just have a look at its issues queue.Why can't it just be added outside of the default set -- something people would enable if they wanted?
Reacted by Georges Varouchas, Federico Mengozzi, Marco Mayer, Arne Van Maele, Thomas Güttler, Jerome Froelich, Cayden Meyer, Mateusz Urbanek, Marius van Niekerk, Hank and 46 moreI've created a custom plugin to be used locally and in GHA
Reacted by Michael Freeman and Yuxin Wang(I have horrible experience with using plugins, because you need to keep tracking all the versions, and it produces inscrutable error messages when things go wrong. But, if it helps anyone... good)
Reacted by Mohamed Badawi, Yuxin Wang and Michael Freemanyeah i can tell :D , but i've considered that in that plugin and the script with it should be able to detect the dependancies version and force it before building it
(I have horrible experience with using plugins, because you need to keep tracking all the versions, and it produces inscrutable error messages when things go wrong. But, if it helps anyone... good)
I agree. I have proposed an alternative way for integrating private linters from learnings of caddy the web server written in Go: #2505 (comment) which makes it easier to build a single custom binary (with the private linter code). Not sure if golangci-lint folks will like it 😃
If we have to build a plugin, we're happy to add some logic (e.g., the
Newfunction) to make it easier to build NilAway as a plugin.Reacted by Anton GilgurSomewhat related - golang/go#63290
Your feature request related to a problem? Please describe.
NilAway is a static analysis tool that seeks to help developers avoid nil panics in production by catching them at compile time rather than runtime.
Describe the solution you'd like.
https://github.com/uber-go/nilaway
Describe alternatives you've considered.
-Additional context.
IIUC, nilaway is more like a "tool" rather than a linter.
/cc @yuxincs @zzqatuber