| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |