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
Support deriving Collection #146
Conversation
This is looking great so far. Thank you for adding trybuild -- the existing macros didn't have ui tests, with that added I'll be able to go back and get coverage over them. |
Also, not sure if we can somehow get the procmacros to be imported with the trait like the serde ones. Not sure what they are doing, tho. I think for clap 3.0 you also don't need to import the derive macro separately from the traits. Maybe it's really simple and I just overlooked it :D |
Hah, so I just discovered that the other proc macro in that crate is unused. I moved it to actionable. You should be able to put I should have also asked -- are you wanting to get this merged as-is, and come back to implement the views argument later? Happy to do a partial merge to get this baseline functionality in if that's what you were aiming for. |
Should I just remove it in this PR? |
a983e59
to
d9053ea
Compare
@ecton I'm not able to request a review, but I think it should be done implementation wise. |
It was probably because I never actually "responded" to the original request. I actually did the action this time, so hopefully the flow works correctly next time -- still getting used to the github flow. This looks great! I've added a comment about the one TODO left. |
Sure, sorry for missing this in the first pass through. If you didn't, I was just going to do it post-merge. |
be6afec
to
470ddf1
Compare
I think the macros should work now :D Feel free to add some testcases that make more sense. Exspecially for the view derive I was not sure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really great! The attribute-macro crate you've written looks really nice.
I only noticed one feature I failed to think about until this review.
If you'd like to do one more request (pushed 8d84ac1), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, kick this back for review one last time once you've released the new attribute crate (and optionally add support for optional authority).
I was thinking about this. Should here maybe be a way to disable this automatic behaviour, like a custom |
I also added trybuild to test the error messages of derive macro. The macro does not check for name validity as the restrictions will be removed khonsulabs#143 (comment). closes khonsulabs#138 partially
e07cd39
to
bc631ed
Compare
bc631ed
to
3abae7d
Compare
It totally makes sense. I don't think it's strictly necessary -- a
The last concern I have is that feature flags are additive -- if you can figure out a way to allow a single crate to "deny private names" without infecting all other crates, I'd love to see that feature. But I'm worried that a third party library import could all of a sudden break your project because it enabled the deny-private-names feature. |
Totally makes sense. This is also something that can be easily added after the fact.
Maybe I forgot how the features for crates work. I thought this would be fine:
But I now remember there was something about using a crate with different features as rust obviously cannot figure out that this feature only effects proc_macro expansion and not actually |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, just noticed some version numbers update that shouldn't have been, and decided it was a good opportunity to try the Sugguest Changes feature in GitHub.
Co-authored-by: Jonathan Johnson <jon@khonsulabs.com>
Let's hope it worked :D |
I also added trybuild to test the error messages of derive macro.
The macro does not check for name validity as the restrictions will be
removed #143 (comment).
closes #138