Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upFormat all code with rustfmt #21373
Format all code with rustfmt #21373
Comments
|
Hi! If you have any questions regarding this issue, feel free to make a comment here, or ask it in the If you intend to work on this issue, then add |
|
We now have a |
|
Hi, I would like to work on this and will probably start from formatting the first component on the top. @highfive: assign me |
|
Hey @kingdido999! Thanks for your interest in working on this issue. It's now assigned to you! |
|
So I've successfully built the project and ran
So I look into the rustfmt command defined in
Despite the error, it does run the formatting but for all files in the project, which is not what we want. If I provide a file path instead of a directory path, no error is shown but it formats the entire project again. My best guess is that Directly run rustfmt components/allocator/lib.rsHere are the versions of $ rustc --version
rustc 1.29.0-nightly (1ecf6929d 2018-07-16)
$ rustfmt --version
rustfmt 0.8.2-nightly (5e599251 2018-07-02)@jdm @JoshBrudnak Please let me know if I'm missing something when I do |
|
I've verified that you're not missing anything. |
|
Sure I will work on it. |
|
I'm trying to get a rough idea on the use cases of rustfmt ports/servo/**/*.rs |
|
Sure, that would work. I meant to make this issue possible for multiple people to work on in parallel since there are so many components, so I figured a mach command would be the easiest way to support that. |
Format component allocator <!-- Please describe your changes on the following line: --> Format `components/allocator` with: ```bash rustfmt components/allocator/*.rs ``` --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [ ] `./mach build -d` does not report any errors. Waiting for #21423 to be resolved. - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix a part of #21373. - [x] These changes do not require tests because they format the code only. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21428) <!-- Reviewable:end -->
Format component allocator <!-- Please describe your changes on the following line: --> Format `components/allocator` with: ```bash rustfmt components/allocator/*.rs ``` --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [ ] `./mach build -d` does not report any errors. Waiting for #21423 to be resolved. - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix a part of #21373. - [x] These changes do not require tests because they format the code only. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21428) <!-- Reviewable:end -->
Format components atoms <!-- Please describe your changes on the following line: --> ```bash rustfmt components/atoms/*.rs ``` --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix a part of #21373 . - [x] These changes do not require tests because it's code format change. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21440) <!-- Reviewable:end -->
Format components bluetooth and bluetooth_traits <!-- Please describe your changes on the following line: --> ```bash rustfmt components/bluetooth/*.rs rustfmt components/bluetooth_traits/*.rs ``` --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix a part of #21373 . - [x] These changes do not require tests because it's code format change. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21442) <!-- Reviewable:end -->
|
Hi.I'd like to work on this too.I will start from the component on the bottom:) |
Format components canvas and canvas_traits #21373 <!-- Please describe your changes on the following line: --> ```bash rustfmt components/canvas/**/*.rs rustfmt components/canvas_traits/**/*.rs ``` <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21538) <!-- Reviewable:end -->
Format component compositing #21373 <!-- Please describe your changes on the following line: --> ```bash rustfmt components/compositing/*.rs ``` <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21551) <!-- Reviewable:end -->
Format component compositing #21373 <!-- Please describe your changes on the following line: --> ```bash rustfmt components/compositing/*.rs ``` <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21551) <!-- Reviewable:end -->
format components/profile Issue #21373 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21651) <!-- Reviewable:end -->
Format component servo <!-- Please describe your changes on the following line: --> Format components with: `rustfmt components/servo/*.rs` --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix part of #21373. - [x] These changes do not require tests because <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21664) <!-- Reviewable:end -->
Format jstraceable_derive #21373 ```bash rustfmt components/jstraceable_derive/*.rs ``` <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21655) <!-- Reviewable:end -->
format components/profile_traits Issue: #21373 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21657) <!-- Reviewable:end -->
Format component size_of_test <!-- Please describe your changes on the following line: --> Format `components/size_of_test` by: ``` rustfmt components/size_of_test/*.rs ``` --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix part of #21373. - [x] These changes do not require tests because they format code only. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21661) <!-- Reviewable:end -->
Format components metrics and msg #21373 ```bash rustfmt components/metrics/lib.rs rustfmt components/msg/*.rs rustfmt components/msg/tests/*.rs ``` <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21672) <!-- Reviewable:end -->
Format ports/libsimpleservo <!-- Please describe your changes on the following line: --> Format `ports/libsimpleservo` with: `rustfmt ports/libsimpleservo/*.rs` --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix part of #21373. - [x] These changes do not require tests because they format code only. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21675) <!-- Reviewable:end -->
Format components metrics and msg #21373 ```bash rustfmt components/metrics/lib.rs rustfmt components/msg/*.rs rustfmt components/msg/tests/*.rs ``` <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21672) <!-- Reviewable:end -->
Format components metrics and msg #21373 ```bash rustfmt components/metrics/lib.rs rustfmt components/msg/*.rs rustfmt components/msg/tests/*.rs ``` <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21672) <!-- Reviewable:end -->
|
|
Format components/script_traits <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix part of #21373. - [x] These changes do not require tests because format the code only. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21693) <!-- Reviewable:end -->
Format components/script_plugins <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix part of #21373. - [x] These changes do not require tests because they formatting code only. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21694) <!-- Reviewable:end -->
Format script component --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix part of #21373. - [x] These changes do not require tests because they format code only. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21737) <!-- Reviewable:end -->
|
Hi, formatting is almost complete. I'd like to suggest that servo adopts a new formatting for I would want to split the imports into 4 groups (std, third-party imports, workspace imports, imports from the same crate) and sort those groups individually. (See rust-lang/rustfmt#2979) Additionally I prefer to use The grouping can be done with a script. This could either be added to |
Format net and net_traits crates Manually formatted the fetch_scheme file portion to limit right drift. Part of #21373 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22099) <!-- Reviewable:end -->
Format net and net_traits crates Manually formatted the fetch_scheme file portion to limit right drift. Part of #21373 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22099) <!-- Reviewable:end -->
|
@jdm I see the last components from the list net and net_traits was formatted in #22099. |
|
#20617 still needs to be finished. |
|
Fixed in #22126 |
#8553 (comment) describes a configuration that respects some style settings that we care about. I think it's worth systematically formatting Servo's code crate by crate (or module by module in the case of particularly large crates) and then integrating the changes in #20617 to enforce proper style in our CI.
Components:
ports: