| OLD | NEW |
| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 "whitespace/newline". | 42 "whitespace/newline". |
| 43 confidence: An integer between 1 and 5 inclusive that represents the | 43 confidence: An integer between 1 and 5 inclusive that represents the |
| 44 application's level of confidence in the error. The value | 44 application's level of confidence in the error. The value |
| 45 5 means that we are certain of the problem, and the | 45 5 means that we are certain of the problem, and the |
| 46 value 1 means that it could be a legitimate construct. | 46 value 1 means that it could be a legitimate construct. |
| 47 message: The error message to report. | 47 message: The error message to report. |
| 48 | 48 |
| 49 """ | 49 """ |
| 50 | 50 |
| 51 | 51 |
| 52 import sys | |
| 53 | 52 |
| 54 | 53 |
| 55 class DefaultStyleErrorHandler(object): | 54 class DefaultStyleErrorHandler(object): |
| 56 | 55 |
| 57 """The default style error handler.""" | 56 """The default style error handler.""" |
| 58 | 57 |
| 59 def __init__(self, file_path, configuration, increment_error_count, | 58 def __init__(self, file_path, configuration, increment_error_count, |
| 60 line_numbers=None): | 59 line_numbers=None): |
| 61 """Create a default style error handler. | 60 """Create a default style error handler. |
| 62 | 61 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 154 |
| 156 self._configuration.write_style_error(category=category, | 155 self._configuration.write_style_error(category=category, |
| 157 confidence_in_error=confidence, | 156 confidence_in_error=confidence, |
| 158 file_path=self._file_path, | 157 file_path=self._file_path, |
| 159 line_number=line_number, | 158 line_number=line_number, |
| 160 message=message) | 159 message=message) |
| 161 if category_total == max_reports: | 160 if category_total == max_reports: |
| 162 self._configuration.stderr_write("Suppressing further [%s] reports " | 161 self._configuration.stderr_write("Suppressing further [%s] reports " |
| 163 "for this file.\n" % category) | 162 "for this file.\n" % category) |
| 164 return True | 163 return True |
| OLD | NEW |