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 rustfmt.toml file with some clean guidlines. #76

Conversation

brandonpollack23
Copy link
Contributor

Note: Though seemingly large this change is a total no-op and run with cargo fmt only, just he simplest thing I could think of for a first issue.

This is based on my own rustfmt.toml I usually use. I tend to set these for the following reasons:

imports_granularity = "Crate" # this combines a bunch of lines at the top, but it doesnt match google style so I removed it tab_spaces = 2 # param lists and chained calls tend to be longer and more common in rust, I think this increases readability fn_params_layout = "Tall" # this is way easier to read than non tall format_strings = true
use_try_shorthand = true # replace any ugly try! macros with the pretty ? wrap_comments = true
max_width = 100 # If we can do it in Java, we can do it in Rust

for issue #74

Copy link
Collaborator

@HidenoriKobayashi HidenoriKobayashi left a comment

Choose a reason for hiding this comment

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

I'm mostly fine with this change, except for the tab_spaces.

Although, I can probably live with it, if everybody else prefers it to be 2.

rustfmt.toml Outdated Show resolved Hide resolved
@brandonpollack23 brandonpollack23 force-pushed the rustfmt_file_and_formatting branch 3 times, most recently from 56b52f1 to 1cceca1 Compare October 2, 2023 06:03
This is based on my own rustfmt.toml I usually use. I tend to set these for the following reasons:

imports_granularity = "Crate" # this combines a bunch of lines at the top, but it doesnt match google style so I removed it
tab_spaces = 2 # param lists and chained calls tend to be longer and more common in rust, I think this increases readability
fn_args_layout = "Tall" # this is way easier to read than non tall
format_strings = true
use_try_shorthand = true # replace any ugly try! macros with the pretty ?
wrap_comments = true
max_width = 100 # If we can do it in Java, we can do it in Rust

<!-- ps-id: 7ae174e0-2475-4f45-ae7a-7c8c3f23e8eb -->
@brandonpollack23
Copy link
Contributor Author

Closing this PR because it is included in the "Starter Changes PR"

Feel free to comment on that for the PR to be split up at a certain point.

@brandonpollack23 brandonpollack23 deleted the rustfmt_file_and_formatting branch October 3, 2023 06:37
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.

2 participants