-
Notifications
You must be signed in to change notification settings - Fork 21
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
Make custom lints #[allow]
-able without warnings
#28
Comments
Thanks for your kind words, @danielhenrymantilla, and thanks for this suggestion. :) The way I am dealing with this problem now is to just allow the Lines 209 to 210 in 3966910
If we put all of the examples in a Your second idea is intriguing one. I'm just wondering whether it's a little heavy-handed compared to I want to be sure that we're solving the right problem, though. You would like the example lints to be put in their own namespace? Because if you write your own lints, you could put them in their own namespace. This might be a viable solution if you don't mind having to compile with a nightly compiler. If your code originates from Apologies if I've misunderstood your intent. |
Thanks for the remarks, I didn't know well the implication of tool lints w.r.t. stability, so indeed the first solution is not that good, yet 👍 W.r.t. the second one, basically, the issue with
It's still the least bad solution in the interim, but I was wondering how hard would it be for Asides
|
I get it, and I agree that the
I don't think it would be too hard. I think my main concern is the additional complexity it would introduce when there is a workable solution now, and a better solution potentially around the corner.
Thanks! I didn't know this existed.
Done (ee8fb3c).
These are good suggestions. I've opened issues for them (#31 and #32). |
Given that stabilization of The one change I would like to make is that the option be:
So in code, one would write: #![cfg_attr(dylint_lib="library_name", allow(lint_name))] (As before, there could be multiple such One reason for doing it this way is: getting the library name is easy, but getting the lint / lint pass names is more challenging, because one has to load and run code from the library. Moreover, I think this approach is intuitive. Lints are already loaded "in batches," i.e., with each library being a "batch." This approach would similarly enable these lint level settings "in batches." @danielhenrymantilla I'm curious if you'd still be interested to work on this. |
Heh, FWIW I was interested by this but have been super busy, thank you @smoelius for taking care of it! 👌 |
No problem. It was a really good suggestion. Thanks again for proposing it. 🙏 |
First of all, awesome project and initiative, I love it!
No matter how good the custom-defined lints may be, at some point we may wish to
#[allow(…)]
-silence/gag them. Alas, the naïve#[allow(lint_name)]
, e.g.,#[allow(allow_clippy)]
, triggers warnings from theunknown_lint
lint.Would it be possible to offer a way to prevent this? I personally have two ideas in that regard:
Prefix / namespace the lints, much like
clippy
does:#[allow(dylint::allow_clippy)]
. Then do the shenanigans to makerustc
understand about this prefix (is it a customtool
?)Whenever the pass including a driver is being run, have
--cfg dylint_pass(that_lint_name)
added torustc
. Given that several lints may be coalesced into a single driver pass (the very point ofdylint
's design, IIUC), this may enable several suchcfg
s simultaneously, which is not a problem but something to be mindful of.This way, one can, at least, do something like:
#![cfg_attr(dylint_pass(lint_name), allow(lint_name))]
The text was updated successfully, but these errors were encountered: