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

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

Issue 1839193004: Run auto-formatter (autopep8) on webkitpy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 8 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 100
101 return True 101 return True
102 102
103 # Useful for unit testing. 103 # Useful for unit testing.
104 def __ne__(self, other): 104 def __ne__(self, other):
105 # Python does not automatically deduce __ne__ from __eq__. 105 # Python does not automatically deduce __ne__ from __eq__.
106 return not self.__eq__(other) 106 return not self.__eq__(other)
107 107
108 def _add_reportable_error(self, category): 108 def _add_reportable_error(self, category):
109 """Increment the error count and return the new category total.""" 109 """Increment the error count and return the new category total."""
110 self._increment_error_count() # Increment the total. 110 self._increment_error_count() # Increment the total.
111 111
112 # Increment the category total. 112 # Increment the category total.
113 if not category in self._category_totals: 113 if not category in self._category_totals:
114 self._category_totals[category] = 1 114 self._category_totals[category] = 1
115 else: 115 else:
116 self._category_totals[category] += 1 116 self._category_totals[category] += 1
117 117
118 return self._category_totals[category] 118 return self._category_totals[category]
119 119
120 def _max_reports(self, category): 120 def _max_reports(self, category):
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 155
156 self._configuration.write_style_error(category=category, 156 self._configuration.write_style_error(category=category,
157 confidence_in_error=confidence, 157 confidence_in_error=confidence,
158 file_path=self._file_path, 158 file_path=self._file_path,
159 line_number=line_number, 159 line_number=line_number,
160 message=message) 160 message=message)
161 if category_total == max_reports: 161 if category_total == max_reports:
162 self._configuration.stderr_write("Suppressing further [%s] reports " 162 self._configuration.stderr_write("Suppressing further [%s] reports "
163 "for this file.\n" % category) 163 "for this file.\n" % category)
164 return True 164 return True
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698