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

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/python.py

Issue 2014063002: Run format-webkit on webkitpy code (without string conversion). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months 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 (C) 2010 Chris Jerdonek (cjerdonek@webkit.org) 1 # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions 4 # modification, are permitted provided that the following conditions
5 # are met: 5 # are met:
6 # 1. Redistributions of source code must retain the above copyright 6 # 1. Redistributions of source code must retain the above copyright
7 # notice, this list of conditions and the following disclaimer. 7 # notice, this list of conditions and the following disclaimer.
8 # 2. Redistributions in binary form must reproduce the above copyright 8 # 2. Redistributions in binary form must reproduce the above copyright
9 # notice, this list of conditions and the following disclaimer in the 9 # notice, this list of conditions and the following disclaimer in the
10 # documentation and/or other materials provided with the distribution. 10 # documentation and/or other materials provided with the distribution.
(...skipping 16 matching lines...) Expand all
27 import sys 27 import sys
28 28
29 29
30 from webkitpy.common.system.filesystem import FileSystem 30 from webkitpy.common.system.filesystem import FileSystem
31 from webkitpy.common.system.executive import Executive 31 from webkitpy.common.system.executive import Executive
32 from webkitpy.common.webkit_finder import WebKitFinder 32 from webkitpy.common.webkit_finder import WebKitFinder
33 from webkitpy.thirdparty import pep8 33 from webkitpy.thirdparty import pep8
34 34
35 35
36 class PythonChecker(object): 36 class PythonChecker(object):
37
37 """Processes text lines for checking style.""" 38 """Processes text lines for checking style."""
38 39
39 def __init__(self, file_path, handle_style_error): 40 def __init__(self, file_path, handle_style_error):
40 self._file_path = file_path 41 self._file_path = file_path
41 self._handle_style_error = handle_style_error 42 self._handle_style_error = handle_style_error
42 43
43 def check(self, lines): 44 def check(self, lines):
44 self._check_pep8(lines) 45 self._check_pep8(lines)
45 self._check_pylint(lines) 46 self._check_pylint(lines)
46 47
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 114
114 line_number = int(match_obj.group(2)) 115 line_number = int(match_obj.group(2))
115 category_and_method = match_obj.group(3).split(', ') 116 category_and_method = match_obj.group(3).split(', ')
116 category = 'pylint/' + (category_and_method[0]) 117 category = 'pylint/' + (category_and_method[0])
117 if len(category_and_method) > 1: 118 if len(category_and_method) > 1:
118 message = '[%s] %s' % (category_and_method[1], match_obj.group(4 )) 119 message = '[%s] %s' % (category_and_method[1], match_obj.group(4 ))
119 else: 120 else:
120 message = match_obj.group(4) 121 message = match_obj.group(4)
121 errors.append((line_number, category, message)) 122 errors.append((line_number, category, message))
122 return errors 123 return errors
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698