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

Unified Diff: chrome/browser/resources/web_dev_style/js_checker.py

Issue 251713002: web_dev_style: add check for ending jsdoc comments with **/ instead of */. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: upstream => master Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/test_presubmit.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/web_dev_style/js_checker.py
diff --git a/chrome/browser/resources/web_dev_style/js_checker.py b/chrome/browser/resources/web_dev_style/js_checker.py
index 860c27bfa4e861b48b085fc7de04d1fec4308cd7..6e2e10ea271883dbc7e246aade81b3ae7128bd00 100644
--- a/chrome/browser/resources/web_dev_style/js_checker.py
+++ b/chrome/browser/resources/web_dev_style/js_checker.py
@@ -50,6 +50,12 @@ class JSChecker(object):
return self.RegexCheck(i, line, r'(?:^|\s|\()(const)\s',
'Use /** @const */ var varName; instead of const varName;')
+ def EndJsDocCommentCheck(self, i, line):
+ msg = 'End JSDoc comments with */ instead of **/'
+ def _check(regex):
+ return self.RegexCheck(i, line, regex, msg)
+ return _check(r'^\s*(\*\*/)\s*$') or _check(r'/\*\* @[a-zA-Z]+.* (\*\*/)')
+
def GetElementByIdCheck(self, i, line):
"""Checks for use of 'document.getElementById' instead of '$'."""
return self.RegexCheck(i, line, r"(document\.getElementById)\('",
« no previous file with comments | « chrome/browser/resources/test_presubmit.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698