-
-
Notifications
You must be signed in to change notification settings - Fork 788
fix: allow non_snake_case
and dead_code
lints to run within component functions
#3198
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
Conversation
f68c42b
to
61c6c0b
Compare
The |
61c6c0b
to
b2efdc3
Compare
I don't know why, but I might've run into a |
Oh, nevermind, I see what happened here. Perhaps we can have a Not sure if that would work, but worth a shot |
Hi @yescallop. Wanted to check in to see if you had time to check out my comments? |
Hi @rakshith-ravi. I guess I get your point. Do you mean something like the following? #[allow(non_snake_case)]
fn __Example() {
#[warn(non_snake_case)]
{
// body wrapped, this will warn
let A = ();
}
} But I notice that an inner attribute |
Oh my. Yeah I didn't think about that. Valid point indeed. It just seems very "hacky" to do a Any other suggestion you have? If not, I guess this could do for now. We can always clean it up later if we think of a better solution |
My only feedback would be that the |
Changes made @gbj |
@rakshith-ravi Looks like it's been a bit since this was made. If you can resolve the commits I'll see about merging it |
Conflicts resolved @benwis |
I've triggered the CI. Let's see if there's any issues |
Thanks for the PR! |
Currently, the
non_snake_case
anddead_code
lints will not run within component functions because thecomponent
macro emitsallow
attributes for the two lints, which allows room for users to make mistakes. This PR fixes the problem by converting the function name to snake case before prefixing it with__
and dropping theallow
attributes for the two lints from the macro.I have run
cargo check
on the library and all examples and see no additional warnings. We can have the CI confirm this.