Skip to content

Format parts of layout - #19681

Merged
bors-servo merged 1 commit into
servo:masterfrom
pyfisch:rustfmt-display-lists
Jan 4, 2018
Merged

bors-servo merged 1 commit into
servo:masterfrom
pyfisch:rustfmt-display-lists

Conversation

@pyfisch

@pyfisch pyfisch commented Jan 3, 2018 •

Copy link
Copy Markdown
Contributor

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

highfive commented Jan 3, 2018

Copy link
Copy Markdown

Heads up! This PR modifies the following files:

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

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jan 3, 2018
@highfive

highfive commented Jan 3, 2018

Copy link
Copy Markdown

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) => {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@jdm

jdm commented Jan 3, 2018

Copy link
Copy Markdown
Member

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

@emilio

emilio commented Jan 4, 2018

Copy link
Copy Markdown
Member

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

@emilio

emilio commented Jan 4, 2018

Copy link
Copy Markdown
Member

@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
Copy Markdown
Contributor

📌 Commit 83bce46 has been approved by emilio

@highfive highfive assigned emilio and unassigned cbrewster Jan 4, 2018
@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Jan 4, 2018
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 83bce46 with merge 3692f13...

bors-servo pushed 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
Copy Markdown
Contributor

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev
Approved by: emilio
Pushing 3692f13 to master...

@bors-servo
bors-servo merged commit 83bce46 into servo:master Jan 4, 2018
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jan 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants