-
Notifications
You must be signed in to change notification settings - Fork 912
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
Skip Attribute #3665
Comments
It seems like a good idea given that, like macro calls, attributes can have an arbitral token stream as their arguments. |
Adding a new |
I'm done with base implementation but is just a cut and paste of The second one solution touch lot of files so maybe is better do a separate pull request but merge just sub attributes left things less cohesive. What do you think? |
@la10736 a separate PR would probably be better |
I already did the PR with just refactoring |
Attributes are evolving and now are used also to create DSL. Now, by the rising of procedural macro and the possibility to use arbitrary rust code in attributes syntax formatting attribute by simple rules based on meta and nested meta can produce some formatting that make the procedural macro DSL not clear.
For instance I have a crate of mine la10736/rstest that you can use to write tests like this:
Now, use
rustfmt
on this file make it flat and hard to read:Or wrost:
in
We can use
rustfmt::skip::macros()
or a brand newrustfmt::skip::attributes()
to have the ability of skip attributes formatting too.If you are ok I can work on it.
The text was updated successfully, but these errors were encountered: