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 .rustfmt.toml #16
Conversation
Hi, looks good, however is there some way you could set the amount of arguments in a function before separating them vertically in the |
rustfmt's defaults are set to maximum character width = 80, so the function declarations (where some exceed 80 characters) will still be realigned vertically. We can set the maximum character width to 100 (from the default 80) if you prefer. |
Yeah, I think that could work |
@@ -2,7 +2,12 @@ use spinoff::{Spinner, Spinners, Streams}; | |||
use std::{thread::sleep, time::Duration}; | |||
|
|||
fn main() { | |||
let sp = Spinner::new_with_stream(Spinners::Aesthetic, "Loading in stderr...", None, Streams::Stderr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example, this line has 106
characters, so it still gets re-aligned.
I think a max width exceeding 100 is not ideal, so some of the realignments are inescapable.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fine if it gets re-aligned in files like these, which are just examples. It's just a bit more unreadable when it's in the actual internal code itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I guess we don't need to do the formatting stuff.
Before starting work on #15, I saw that there was inconsistent formatting applied to the source code, so I added a
.rustfmt.toml
file and rancargo fmt
. This PR only contains automatically fixed formatting changes.This was to make sure that any future PRs will contain less formatting "noise" and that all contributors get the same output when we run "cargo fmt"