Add 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= Review URL: https://codereview.chromium.org/546613003 git-svn-id: svn://svn.chromium.org/blink/trunk@181690 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Showing
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Please register or sign in to comment