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

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

Issue 2136793002: Remove all unused variables. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 # This will require updating the error handler __call__ 56 # This will require updating the error handler __call__
57 # signature to include an optional "offset" parameter. 57 # signature to include an optional "offset" parameter.
58 pep8_code = text[:4] 58 pep8_code = text[:4]
59 pep8_message = text[5:] 59 pep8_message = text[5:]
60 60
61 category = "pep8/" + pep8_code 61 category = "pep8/" + pep8_code
62 62
63 self._handle_style_error(line_number, category, 5, pep8_message) 63 self._handle_style_error(line_number, category, 5, pep8_message)
64 64
65 pep8_checker.report_error = _pep8_handle_error 65 pep8_checker.report_error = _pep8_handle_error
66 pep8_errors = pep8_checker.check_all() 66 pep8_checker.check_all()
67 67
68 def _check_pylint(self): 68 def _check_pylint(self):
69 output = self.run_pylint(self._file_path) 69 output = self.run_pylint(self._file_path)
70 errors = self._parse_pylint_output(output) 70 errors = self._parse_pylint_output(output)
71 for line_number, category, message in errors: 71 for line_number, category, message in errors:
72 self._handle_style_error(line_number, category, 5, message) 72 self._handle_style_error(line_number, category, 5, message)
73 73
74 def run_pylint(self, path): 74 def run_pylint(self, path):
75 wkf = WebKitFinder(FileSystem()) 75 wkf = WebKitFinder(FileSystem())
76 executive = Executive() 76 executive = Executive()
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 113
114 line_number = int(match_obj.group(2)) 114 line_number = int(match_obj.group(2))
115 category_and_method = match_obj.group(3).split(', ') 115 category_and_method = match_obj.group(3).split(', ')
116 category = 'pylint/' + (category_and_method[0]) 116 category = 'pylint/' + (category_and_method[0])
117 if len(category_and_method) > 1: 117 if len(category_and_method) > 1:
118 message = '[%s] %s' % (category_and_method[1], match_obj.group(4 )) 118 message = '[%s] %s' % (category_and_method[1], match_obj.group(4 ))
119 else: 119 else:
120 message = match_obj.group(4) 120 message = match_obj.group(4)
121 errors.append((line_number, category, message)) 121 errors.append((line_number, category, message))
122 return errors 122 return errors
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698