OLD | NEW |
1 # Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import os | 5 import os |
6 import re | 6 import re |
7 import sys | 7 import sys |
8 import warnings | 8 import warnings |
9 | 9 |
10 from py_vulcanize import strip_js_comments | 10 from py_vulcanize import strip_js_comments |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 if re.search('</?(include|if)', error.token.line): | 113 if re.search('</?(include|if)', error.token.line): |
114 return False # GRIT statement. | 114 return False # GRIT statement. |
115 | 115 |
116 if (error.code == errors.MISSING_SEMICOLON and | 116 if (error.code == errors.MISSING_SEMICOLON and |
117 error.token.string == 'of'): | 117 error.token.string == 'of'): |
118 return False # ES6 for...of statement. | 118 return False # ES6 for...of statement. |
119 | 119 |
120 return error.code not in [ | 120 return error.code not in [ |
121 errors.JSDOC_ILLEGAL_QUESTION_WITH_PIPE, | 121 errors.JSDOC_ILLEGAL_QUESTION_WITH_PIPE, |
122 errors.MISSING_JSDOC_TAG_THIS, | 122 errors.MISSING_JSDOC_TAG_THIS, |
| 123 errors.MISSING_MEMBER_DOCUMENTATION, |
123 ] | 124 ] |
124 | 125 |
125 results = [] | 126 results = [] |
126 | 127 |
127 affected_files = self.input_api.AffectedFiles( | 128 affected_files = self.input_api.AffectedFiles( |
128 file_filter=self.file_filter, | 129 file_filter=self.file_filter, |
129 include_deletes=False) | 130 include_deletes=False) |
130 | 131 |
131 def ShouldCheck(f): | 132 def ShouldCheck(f): |
132 if f.LocalPath().endswith('.js'): | 133 if f.LocalPath().endswith('.js'): |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 | 216 |
216 def RunChecks(input_api, output_api, excluded_paths=None): | 217 def RunChecks(input_api, output_api, excluded_paths=None): |
217 | 218 |
218 def ShouldCheck(affected_file): | 219 def ShouldCheck(affected_file): |
219 if not excluded_paths: | 220 if not excluded_paths: |
220 return True | 221 return True |
221 path = affected_file.LocalPath() | 222 path = affected_file.LocalPath() |
222 return not any(re.match(pattern, path) for pattern in excluded_paths) | 223 return not any(re.match(pattern, path) for pattern in excluded_paths) |
223 | 224 |
224 return JSChecker(input_api, output_api, file_filter=ShouldCheck).RunChecks() | 225 return JSChecker(input_api, output_api, file_filter=ShouldCheck).RunChecks() |
OLD | NEW |