-
Notifications
You must be signed in to change notification settings - Fork 15
New guideline to refer to names with global paths in a macro #76
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
New guideline to refer to names with global paths in a macro #76
Conversation
src/coding-guidelines/macros.rst
Outdated
.. guideline:: Names in a macro definition shall use a global path | ||
:id: gui_SJMrWDYZ0dN4 | ||
:category: advisory |
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.
Hey 👋.
I think it should be mandatory
because even a local use
can easily shadow the intended path and cause unexpected behaviours,
Also not following this guideline will make your nacro non-deterministic and context-dependent.
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.
Thanks for the review. I'm willing to move this to required
, especially if the $crate
path prefix is also allowed for.
Moving it further to mandatory
feels a bit strong, since I feel like there are exotic use cases for shadowing the paths inside of the macro. Right now I can't think of any patterns that use that though, so perhaps there aren't. I've updated category in 6698d44, feel free to let me know if you still think this should be mandatory.
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.
Yes 'mandatory' feels quite strong, maybe this should be discussed in the next meeting.
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.
Hey @vapdrs -- thanks for contributing this guideline! Please take a look at the comments I left.
@vapdrs -- could you rebase? Then we can spin CI |
e0231a3
to
4809d14
Compare
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.
Thanks for putting this together @vapdrs! Looks good to me
As discussed in the 2025-05-07 meeting, a draft of this guideline was asked to be contributed. I'd be interested in any feedback, specifically for the release section, whose specification still seems in flux, and the rationale which I generated but am not sure if it captures the original idea contributor's purpose.