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

Side by Side Diff: catapult_build/js_checks.py

Issue 1679333002: Suppress MISSING_MEMBER_DOCUMENTATION error in jslint (Closed) Base URL: https://github.com/catapult-project/catapult@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698