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

Unified Diff: presubmit_canned_checks.py

Issue 6413004: Add a presubmit test that asserts TODOs have owners.... (Closed) Base URL: http://src.chromium.org/svn/trunk/tools/depot_tools/
Patch Set: Created 9 years, 11 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 | « no previous file | tests/presubmit_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: presubmit_canned_checks.py
===================================================================
--- presubmit_canned_checks.py (revision 73883)
+++ presubmit_canned_checks.py (working copy)
@@ -234,6 +234,18 @@
return []
+def CheckChangeTodoHasOwner(input_api, output_api, source_file_filter=None):
+ """Checks that the user didn't add TODO(name) without an owner."""
+
+ unowned_todo = input_api.re.compile('TO' + 'DO[^(]');
+ for f, line_num, line in input_api.RightHandSideLines(source_file_filter):
+ if unowned_todo.search(line):
+ text = ('Found TO' + 'DO with no owner in %s, line %s' %
+ (f.LocalPath(), line_num))
+ return [output_api.PresubmitPromptWarning(text)]
+ return []
+
+
def CheckChangeHasNoStrayWhitespace(input_api, output_api,
source_file_filter=None):
"""Checks that there is no stray whitespace at source lines end."""
« no previous file with comments | « no previous file | tests/presubmit_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698