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

Fix #5662 #5724

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix #5662 #5724

wants to merge 1 commit into from

Conversation

xldenis
Copy link

@xldenis xldenis commented Mar 26, 2023

Implements #5662 by adding a new unstable option enum_variant_layout.

  • When enum_variant_layout = "Compressed", we no longer reformat the entire enum if a single variant exceeds the allowed line width. Additionally, we don't take into account the size of attributes or doc-comments when making that determination.
  • When enum_variant_layout = "Tall", we perform the existing layout logic: if a single variant would need multiple lines, then format the whole enum to use multiple lines.
  • When enum_variant_layout = "Vertical", we always format variants using multiple lines.

Fixes #5662

@ytmimi
Copy link
Contributor

ytmimi commented Mar 26, 2023

@xldenis Thanks for the PR and your first contribution to rustfmt 🎉!

Really quick, can you double check the issue that you're linking to. The one you've linked to is already closed, and seems unrelated.When you update the issue description can you please link this PR to the issue so that the issue could be closed if this gets merged.

@xldenis
Copy link
Author

xldenis commented Mar 26, 2023

oops I mean #5662

@xldenis xldenis changed the title Fix #5562 Fix #5662 Mar 26, 2023
@ytmimi
Copy link
Contributor

ytmimi commented Mar 26, 2023

@xldenis thanks for clarifying. Could you also amend your commit message.

@xldenis
Copy link
Author

xldenis commented Apr 2, 2023

I don't know if you noticed, but I fixed the commit message.

@ytmimi
Copy link
Contributor

ytmimi commented Apr 5, 2023

@xldenis Thanks for making the update to the commit message! I'll try to set aside some time to review this within the next week or so.

@xldenis
Copy link
Author

xldenis commented Apr 5, 2023

There's no rush :)

@xldenis
Copy link
Author

xldenis commented Jun 1, 2023

👋 any change of getting a review soon?

@calebcartwright
Copy link
Member

wave any change of getting a review soon?

To be fully transparent, probably not.

As a team currently consisting of only two volunteers we are enormously pressed for time, and we've a mountain of work that's really core and part of rustfmt's primary scope. While some parallel efforts are in flight to create some PR review capacity, I think it's highly unlikely that we'll be able to spend any cycles on things like adding new config options.

I appreciate that's not the answer you were hoping for, but I'd rather answer with a disappointing response over not answering at all.

@xldenis
Copy link
Author

xldenis commented Jun 19, 2023

I appreciate that's not the answer you were hoping for, but I'd rather answer with a disappointing response over not answering at all.

No worries! The branch is finished, I'll rebase it if needed whenever it does get reviewed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Avoiding extra linebreaks when doc-comment added to enum
3 participants