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

Unified Diff: chrome/browser/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: merge 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/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/web_dev_style/js_checker.py
diff --git a/chrome/browser/web_dev_style/js_checker.py b/chrome/browser/web_dev_style/js_checker.py
index 8fc411c684d36f02dd8a7507c04c81fe3ce372d2..d7120d9cf136e19cce824974ba611d1cc228330d 100644
--- a/chrome/browser/web_dev_style/js_checker.py
+++ b/chrome/browser/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]+.* (\*\*/)')
Tyler Breisacher (Chromium) 2014/04/25 22:50:43 Instead of \/ you can just write /
Dan Beam 2014/04/26 01:14:37 Done.
+
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/test_presubmit.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698