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

Add a canonical rustfmt config #86

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Add a canonical rustfmt config #86

wants to merge 2 commits into from

Conversation

PoignardAzur
Copy link
Contributor

No description provided.

Comment on lines +34 to +35
# Forces let else blocks to always be their own line(s)
single_line_let_else_max_width = 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we do decide to set this, I'd expect it to have the same value as single_line_if_else_max_width, I think.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, they seem very similar and have identical default values.

use_field_init_shorthand = true

# Forces let else blocks to always be their own line(s)
single_line_let_else_max_width = 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obviously this isn't used at all in Linebender yet. This is a reasonable value, but I'd lean more towards keeping the default without very good reason, for consistency with the rest of the ecosystem.

This is certainly more taste based than the other two options here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For what it's worth I copy-pasted it from the xilem repo.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. Fair. I don't care that much either way.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we approved it in xilem#305. What I said back then still applies for me: it's quite minor and so I don't personally care much either way.

I believe this was originally added by you @PoignardAzur. So if you still think it's worth having, then I'm fine with it and don't want to bikeshed it. However, if you're not arguing for its benefit, then I don't think we have anyone doing that and we should omit it by default as Daniel mentioned.

Copy link
Member

@xStrom xStrom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Properly standardizing this across repos has been a long time coming, thanks for getting the ball actually rolling.

content/wiki/formatting_scheme.md Show resolved Hide resolved
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 this pull request may close these issues.

3 participants