Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(339)

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/formatter/main.py

Issue 2578213005: Use underscores to separate words in filenames in webkitpy. (Closed)
Patch Set: Fix check for attribute in output_capture.py. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import argparse 5 import argparse
6 import lib2to3.refactor 6 import lib2to3.refactor
7 7
8 from webkitpy.common.system.systemhost import SystemHost 8 from webkitpy.common.system.system_host import SystemHost
9 from webkitpy.thirdparty import autopep8 9 from webkitpy.thirdparty import autopep8
10 10
11 11
12 def parse_args(args=None): 12 def parse_args(args=None):
13 parser = argparse.ArgumentParser() 13 parser = argparse.ArgumentParser()
14 parser.add_argument('--chromium', action='store_const', dest='style', const= 'chromium', default='blink', 14 parser.add_argument('--chromium', action='store_const', dest='style', const= 'chromium', default='blink',
15 help="Format according to Chromium's Python coding style s instead of Blink's.") 15 help="Format according to Chromium's Python coding style s instead of Blink's.")
16 parser.add_argument('--no-backups', action='store_false', default=True, dest ='backup', 16 parser.add_argument('--no-backups', action='store_false', default=True, dest ='backup',
17 help='Do not back up files before overwriting them.') 17 help='Do not back up files before overwriting them.')
18 parser.add_argument('-j', '--jobs', metavar='n', type=int, default=0, 18 parser.add_argument('-j', '--jobs', metavar='n', type=int, default=0,
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 101
102 if autopep8_options: 102 if autopep8_options:
103 tmp_str = autopep8.fix_code(tmp_str, autopep8_options) 103 tmp_str = autopep8.fix_code(tmp_str, autopep8_options)
104 104
105 if fixers: 105 if fixers:
106 tool = lib2to3.refactor.RefactoringTool(fixer_names=fixers, 106 tool = lib2to3.refactor.RefactoringTool(fixer_names=fixers,
107 explicit=fixers) 107 explicit=fixers)
108 tmp_str = unicode(tool.refactor_string(tmp_str, name=name)) 108 tmp_str = unicode(tool.refactor_string(tmp_str, name=name))
109 109
110 return tmp_str 110 return tmp_str
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698