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

Side by Side Diff: Source/devtools/scripts/compile_frontend.py

Issue 340513003: DevTools: Add JSDoc for static methods, fix JSDoc types and induced errors (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 Google Inc. All rights reserved. 2 # Copyright (c) 2012 Google Inc. All rights reserved.
3 # 3 #
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are 5 # modification, are permitted provided that the following conditions are
6 # met: 6 # met:
7 # 7 #
8 # * Redistributions of source code must retain the above copyright 8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above 10 # * Redistributions in binary form must reproduce the above
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 "source_frame/SourceFrame.js", 85 "source_frame/SourceFrame.js",
86 ] 86 ]
87 87
88 type_checked_jsdoc_tags_list = ["param", "return", "type", "enum"] 88 type_checked_jsdoc_tags_list = ["param", "return", "type", "enum"]
89 89
90 type_checked_jsdoc_tags_or = "|".join(type_checked_jsdoc_tags_list) 90 type_checked_jsdoc_tags_or = "|".join(type_checked_jsdoc_tags_list)
91 91
92 # Basic regex for invalid JsDoc types: an object type name ([A-Z][A-Za-z0-9.]+[A -Za-z0-9]) not preceded by '!', '?', ':' (this, new), or '.' (object property). 92 # Basic regex for invalid JsDoc types: an object type name ([A-Z][A-Za-z0-9.]+[A -Za-z0-9]) not preceded by '!', '?', ':' (this, new), or '.' (object property).
93 invalid_type_regex = re.compile(r"@(?:" + type_checked_jsdoc_tags_or + r")\s*\{. *(?<![!?:.A-Za-z0-9])([A-Z][A-Za-z0-9.]+[A-Za-z0-9])[^/]*\}") 93 invalid_type_regex = re.compile(r"@(?:" + type_checked_jsdoc_tags_or + r")\s*\{. *(?<![!?:.A-Za-z0-9])([A-Z][A-Za-z0-9.]+[A-Za-z0-9])[^/]*\}")
94 94
95 invalid_type_designator_regex = re.compile(r"@(?:" + type_checked_jsdoc_tags_or + r")\s*.*([?!])=?\}") 95 invalid_type_designator_regex = re.compile(r"@(?:" + type_checked_jsdoc_tags_or + r")\s*.*(?<![{: ])([?!])=?\}")
aandrey 2014/06/17 11:33:54 hard to review
96 96
97 importscript_regex = re.compile(r"importScript\(\s*[\"']") 97 importscript_regex = re.compile(r"importScript\(\s*[\"']")
98 error_warning_regex = re.compile(r"(?:WARNING|ERROR)") 98 error_warning_regex = re.compile(r"(?:WARNING|ERROR)")
99 99
100 errors_found = False 100 errors_found = False
101 101
102 102
103 def hasErrors(output): 103 def hasErrors(output):
104 return re.search(error_warning_regex, output) != None 104 return re.search(error_warning_regex, output) != None
105 105
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 errors_found |= hasErrors(validateInjectedScriptOut) 393 errors_found |= hasErrors(validateInjectedScriptOut)
394 394
395 if errors_found: 395 if errors_found:
396 print "ERRORS DETECTED" 396 print "ERRORS DETECTED"
397 397
398 os.remove(injectedScriptSourceTmpFile) 398 os.remove(injectedScriptSourceTmpFile)
399 os.remove(injectedScriptCanvasModuleSourceTmpFile) 399 os.remove(injectedScriptCanvasModuleSourceTmpFile)
400 os.remove(compiler_args_file.name) 400 os.remove(compiler_args_file.name)
401 os.remove(protocol_externs_file) 401 os.remove(protocol_externs_file)
402 shutil.rmtree(modules_dir, True) 402 shutil.rmtree(modules_dir, True)
OLDNEW
« Source/devtools/front_end/ui/SidebarPane.js ('K') | « Source/devtools/front_end/ui/treeoutline.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698