-
-
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
Fix case warning on derived properties #1929
Conversation
I'm open to a better suggestion instead of |
I would prefer if we added attributes to suppress these error messages instead. |
Why not use the right conventions? I'd prefer to keep the code, even generated code, according to the conventions |
+1 to keeping the right conventions. |
When deriving `Properties`, the compiler sometimes complains of the non-Camel-case `Foo_build`. This fixes the issue.
I guess I should've clarified. I totally agree in this case, I don't see a good reason why the ident should be For instance, here's one case that deserves the attributes: yew/packages/yew-macro/src/derive_props/field.rs Lines 33 to 39 in 5e683b7
This type deliberately goes against conventions to draw attention to itself, because it's the only thing a user sees when they don't pass a required prop. |
Fair enough, but in that case it's an error anyways, it's okay if it fails linting :D |
Maybe "MyProps_missing_required_props_id" should be in all caps to make it even more obvious :D |
Well no, the type is named that way regardless of whether the app compile or not. If you managed to get a warning for the
Hmm yeah, that might help. Anyway, I'm just gonna go ahead and merge this. Further changes can be done in subsequent PRs |
Description
Replace the
_build
suffix with aPropsBuild
suffix to respect Camel-case types.When deriving
Properties
, the compiler sometimes complains of thenon-Camel-case
Foo_build
. This fixes the issue.Checklist
cargo make pr-flow