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

Report use statements that use {} with only one entry #11320

Closed
jdm opened this issue May 21, 2016 · 2 comments
Closed

Report use statements that use {} with only one entry #11320

jdm opened this issue May 21, 2016 · 2 comments

Comments

@jdm
Copy link
Member

@jdm jdm commented May 21, 2016

Our desired code style is:

use something::foo::Bar;

not

use something::foo::{Bar};

Let's report these lines automatically as part of test-tidy.

Code: python/tidy/servo_tidy/tidy.py
Test: Add one to test_rust in python/tidy/servo_tidy_tests/test_tidy.py, which checks python/tidy/servo_tidy_tests/rust_tidy.rs. Run with ./mach test-tidy --self.

bors-servo added a commit that referenced this issue May 26, 2016
Report use statements that use {} with only one entry

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 --faster` does not report any errors
- [X ] These changes fix #11320  (github issue number if applicable).

Either:
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

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="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11329)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue May 26, 2016
Report use statements that use {} with only one entry

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 --faster` does not report any errors
- [X ] These changes fix #11320  (github issue number if applicable).

Either:
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

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="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11329)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue May 27, 2016
Report use statements that use {} with only one entry

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 --faster` does not report any errors
- [X ] These changes fix #11320  (github issue number if applicable).

Either:
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

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="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11329)
<!-- Reviewable:end -->
@mbrubeck
Copy link
Contributor

@mbrubeck mbrubeck commented Jun 20, 2016

There's no longer any natural way to format a list of imports from the same module, where just one of the imports needs to wrap to the next line:

// ERROR: use statement contains braces for single import
use script_layout_interface::restyle_damage::{BUBBLE_ISIZES, REFLOW, REFLOW_OUT_OF_FLOW};
use script_layout_interface::restyle_damage::{RESOLVE_GENERATED_CONTENT};

// ERROR: use statement is not in alphabetical order
use script_layout_interface::restyle_damage::{BUBBLE_ISIZES, REFLOW, REFLOW_OUT_OF_FLOW};
use script_layout_interface::restyle_damage::RESOLVE_GENERATED_CONTENT;

Could we either revert this change, or change the alphabetization rule to ignore braces?

@jdm
Copy link
Member Author

@jdm jdm commented Jun 20, 2016

Ignoring braces will require reformatting the whole tree. Reverting this change will be less work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.