Skip to content
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

Format whitespace within attributes #984

Closed
euclio opened this issue May 10, 2016 · 5 comments · Fixed by #1634
Closed

Format whitespace within attributes #984

euclio opened this issue May 10, 2016 · 5 comments · Fixed by #1634

Comments

@euclio
Copy link
Contributor

euclio commented May 10, 2016

I'm not sure if there's a decision on this in the wider Rust community, but I think it'd make sense to format attributes so that attributes are formatted to either

#[cfg(feature="nightly")]

or

#[cfg(feature = "nightly")]
@marcusklaas
Copy link
Contributor

@nrc: do you know if there's enough info in the AST to do this?

@nrc
Copy link
Member

nrc commented May 18, 2016

I don't know, but in any case I plan to change the representation of attributes pretty soon as part of the macro reform work.

@marcusklaas
Copy link
Contributor

Okay, probably shouldn't touch this yet then.

@killercup
Copy link
Member

Just came across this, and would love to see this implemented. Especially when looking at code generated with quote!, attributes look weird (e.g., # [ derive ( Clone , PartialEq , Debug , Deserialize , Serialize ) ]).

I assume the final syntax is defined by rust-lang/style-team#82, but the only outstanding issue seems to be minor (spaces around =).

@nrc
Copy link
Member

nrc commented May 28, 2017

I don't know, but in any case I plan to change the representation of attributes pretty soon as part of the macro reform work.

This is now done

topecongiro added a commit to topecongiro/rustfmt that referenced this issue Jun 5, 2017
@nrc nrc closed this as completed in #1634 Jun 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants