Closed sadikovi closed 6 years ago
This relates to #44.
@sunchao Could you review this PR when you have time? I use cargo fmt -- --write-mode=diff
now, instead of travis-cargo
. Thanks!
@sunchao I agree with your comments - I actually had to correct the formatted code in a couple of places as well. Let me review the changes again and see if I can tweak the configuration file to make rust format make changes less aggressively.
@sunchao I updated the rustfmt.toml
to address most of your comments. I also inspected changes manually, and they look okay for the most part (~ 96%).
Could you have a look again and advice on the next steps, e.g. whether or not we even need this? Thanks!
Hi @sadikovi : sorry for the late reply! Is there a way to just enforce max line width + tab width (also maybe the reordering on imports)? my concern is that it currently enforces too many rules and limits flexibility (e.g., sometimes it may be more concise to put everything in a single line but this will break it up into multiple lines for all cases).
You are right 100%, I thought about something along those lines. I will try updating the config to check line width, indentation and maybe couple of other basic rules, and disable the rest.
Will update today, thanks.
@sunchao I could not find the option that would allow to apply only a subset of rules, without applying the rest. It looks like rustfmt
always applies all rules, but checks for values in provided configuration file, if options do not exist in the file, rustfmt
uses default values for those options.
Possible solutions:
Let me know which way you would prefer to go with. I personally think that choosing option 3 might be a good way to start, or we could close it for now, because we have more important stuff to fix.
@sadikovi : I'm also in favor of option 3) for now. We can keep the issue open and come back later if there's better solution. I'm also going to look into why rustfmt
always apply all rules.
Thanks for working on this!
@sunchao could you review this PR again? Thanks! I updated the code manually without any rust format, and this does not include any changes to the build.
Thanks @sunchao! Would you mind merging this PR, if it is okay? If there is anything you want me to change, let me know - I will update the code. Thanks.
Merged! Thanks!, and sorry for the delay @sadikovi .
Thank you very much @sunchao for merging!
This PR formats the source code based on
rustfmt
rules, files were inspected manually, however. Most of the formatting is preserved.