DescriptionAdd a new 'format-webkitpy' command that will reformat code to the style guide.
This is an experimental utility based on autopep8 and lib2to3.
It is capable of reformatting to either the Blink or Chromium style guides (the difference between the two is that Blink uses 132c lines, unix_hacker naming for functions and methods, a 4-space indent, and prefers single-quoted string literals, whereas Chromium uses 80c lines, InitialCaps for functions and methods, a 2-space indent, and double-quoted literals).
Note that format-webkitpy does *not* convert method names between the two conventions, since that is a potentially unsafe thing to do. It is probably possible to write a lib2to3 fixer that does do this relatively safely, but that was more work than I felt like doing for an initial go.
As part of this, we add autopep8 into webkitpy third_party (lib2to3 is part of the standard lib) and update pep8, which hadn't been updated for years.
This patch also adds some simple helper methods to Executive() to do parallel map calls using multiprocessing (and to mock them out properly) so that client code doesn't need to be aware of the hoop-jumping you need to do since hosts aren't picklable. This part of the code is still a little crufty.
BUG=
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=181690
Patch Set 1 : ready for review #
Total comments: 6
Patch Set 2 : remove hack from test/main.py #Messages
Total messages: 10 (5 generated)
|