-
Notifications
You must be signed in to change notification settings - Fork 925
Inconsistent formatting of attributes #2208
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
Comments
Hmm, I assume this isn't a problem with a non-doc comment? Doc comments are treated like attributes, so I think this is formatted like I think we might just want to change the default formatting for attributes on fields to be vertical rather than inline. |
Correct, if I make the comment line non-doc they're both formatted the same (attributes and fields on the same line). |
@nrc I looked at this. Seems we just need to change a parameter to
But many tests fail on this change which will have to be fixed. |
That would change the default to always vertical attributes, yeah. I'm not 100% sure we want that, but I think we probably do. The test fallout is expected with any option default change. If you wanted to take this on, I think it would be good to change the default and fix the tests and see what it looks like. |
@vishalsodani ah, hmm, perhaps this is more interesting to fix. Within an enum variant or tuple struct, then I think attributes should be on the same line, but on fields in a struct they should be on different lines. I think it is probably worth removing |
@nrc Now that |
In this struct:
Both fields have the same attribute but they're formatted differently, because of the comment line in the first one.
The text was updated successfully, but these errors were encountered: