From 6dc0b6f1049427372a5201ccf41e076a959a2622 Mon Sep 17 00:00:00 2001 From: "enne@chromium.org" Date: Wed, 26 Jun 2013 20:21:59 +0000 Subject: cc: Add FIXME presubmit warning R=danakj@chromium.org BUG=none Review URL: https://chromiumcodereview.appspot.com/17904003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208772 0039d316-1c4b-4281-b951-d872f2087c98 --- cc/PRESUBMIT.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'cc/PRESUBMIT.py') diff --git a/cc/PRESUBMIT.py b/cc/PRESUBMIT.py index e133e9a..3f1912b 100644 --- a/cc/PRESUBMIT.py +++ b/cc/PRESUBMIT.py @@ -121,12 +121,29 @@ def CheckPassByValue(input_api, (f.LocalPath(), match.group('type')))) return local_errors +def CheckTodos(input_api, output_api): + errors = [] + + source_file_filter = lambda x: x + for f in input_api.AffectedSourceFiles(source_file_filter): + contents = input_api.ReadFile(f, 'rb') + if ('FIX'+'ME') in contents or re.search(r"TO(?:)DO[^(]", contents): + errors.append(f.LocalPath()) + + if errors: + return [output_api.PresubmitError( + 'All TO'+'DO comments should be of the form TODO(name).', + items=errors)] + return [] + + def CheckChangeOnUpload(input_api, output_api): results = [] results += CheckAsserts(input_api, output_api) results += CheckSpamLogging(input_api, output_api, black_list=CC_PERF_TEST) results += CheckPassByValue(input_api, output_api) results += CheckChangeLintsClean(input_api, output_api) + results += CheckTodos(input_api, output_api) return results def GetPreferredTrySlaves(project, change): -- cgit v1.1