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

Format parts of layout #19681

Merged
merged 1 commit into from Jan 4, 2018
Merged

Format parts of layout #19681

merged 1 commit into from Jan 4, 2018

Conversation

@pyfisch
Copy link
Contributor

pyfisch commented Jan 3, 2018

Formats the following files:

  • components/layout/display_list_builder.rs
  • components/layout/webrender_helpers.rs

Remove outdated options from rustfmt.toml.
Configure rustfmt to place binary operators
at the end of line (to match ./mach test-tidy).

Rationale: I am tired of indenting my patches by hand trying my best to do it correctly and match the surrounding code. Just to be told that either my indentation is wrong or that I should switch to block indentation for this function because it looks better.

The new formatting passes ./mach test-tidy. Compared to the old formatting it is a lot more consistent but also tends to spread the code across more lines. The diff is this big because a lot of code used visual indentation.

See also #8553


This change is Reviewable

Formats the following files:
* components/layout/display_list_builder.rs
* components/layout/webrender_helpers.rs

Remove outdated options from rustfmt.toml.
Configure rustfmt to place binary operators
at the end of line (to match ./mach test-tidy).
@highfive
Copy link

highfive commented Jan 3, 2018

Heads up! This PR modifies the following files:

  • @emilio: components/layout/display_list_builder.rs, components/layout/webrender_helpers.rs
@highfive
Copy link

highfive commented Jan 3, 2018

warning Warning warning

  • These commits modify layout code, but no tests are modified. Please consider adding a test!
GenericFilter::Grayscale(amount) => result.push(webrender_api::FilterOp::Grayscale(amount.0)),
GenericFilter::HueRotate(angle) => result.push(webrender_api::FilterOp::HueRotate(angle.radians())),
GenericFilter::Invert(amount) => result.push(webrender_api::FilterOp::Invert(amount.0)),
GenericFilter::Blur(radius) => {

This comment has been minimized.

@pyfisch

pyfisch Jan 3, 2018

Author Contributor

The formatting here is a bit wasteful but this can be changed by removing the GenericFilter:: and webrender_api:: prefixes.

@jdm
Copy link
Member

jdm commented Jan 3, 2018

I am fine with running rustfmt on individual files at a time like this.

@emilio
Copy link
Member

emilio commented Jan 4, 2018

Looks fine to me too. Specially this file, which is one of the oldest, and has grown organically a lot.

@emilio
emilio approved these changes Jan 4, 2018
@emilio
Copy link
Member

emilio commented Jan 4, 2018

@bors-servo r+

Checked with some people on IRC:

02:46 <emilio> mbrubeck: Are you fine with #19681?
02:46 <crowbot> PR #19681: Format parts of layout - https://github.com/servo/servo/pull/19681
02:47 <@mbrubeck> emilio: It's fine with me.
02:47 <emilio> mbrubeck: I'm more than fine with it, but I don't want to merge it straight-away without your signoff / gw's / pcwalton's
02:48 <@pcwalton> works for me
@bors-servo
Copy link
Contributor

bors-servo commented Jan 4, 2018

📌 Commit 83bce46 has been approved by emilio

@highfive highfive assigned emilio and unassigned cbrewster Jan 4, 2018
@bors-servo
Copy link
Contributor

bors-servo commented Jan 4, 2018

Testing commit 83bce46 with merge 3692f13...

bors-servo added a commit that referenced this pull request Jan 4, 2018
Format parts of layout

Formats the following files:
* components/layout/display_list_builder.rs
* components/layout/webrender_helpers.rs

Remove outdated options from rustfmt.toml.
Configure rustfmt to place binary operators
at the end of line (to match ./mach test-tidy).

Rationale: I am tired of indenting my patches by hand trying my best to do it correctly and match the surrounding code. Just to be told that either my indentation is wrong or that I should switch to block indentation for this function because it looks better.

The new formatting passes `./mach test-tidy`. Compared to the old formatting it is a lot more consistent but also tends to spread the code across more lines. The diff is this big because a lot of code used visual indentation.

See also #8553

<!-- 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/19681)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jan 4, 2018

@bors-servo bors-servo merged commit 83bce46 into servo:master Jan 4, 2018
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

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