diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-22 07:41:40 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-22 07:41:40 +0000 |
commit | 852185659ee97b95d751e6523d994f168aa84c3b (patch) | |
tree | be077174de099f06f0866f93e7aa58cd8aafdd91 /cc/PRESUBMIT.py | |
parent | 3c467a1535ea095e7fc63a8cb9eabff99c8e7041 (diff) | |
download | chromium_src-852185659ee97b95d751e6523d994f168aa84c3b.zip chromium_src-852185659ee97b95d751e6523d994f168aa84c3b.tar.gz chromium_src-852185659ee97b95d751e6523d994f168aa84c3b.tar.bz2 |
Move CheckSpamLogging from cc's PRESUBMIT into the global PRESUBMIT
See thread "[chromium-dev] Say no to excessive debug logging"
BUG=none
Review URL: https://codereview.chromium.org/79173008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236715 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/PRESUBMIT.py')
-rw-r--r-- | cc/PRESUBMIT.py | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/cc/PRESUBMIT.py b/cc/PRESUBMIT.py index 76358f3..daa5246 100644 --- a/cc/PRESUBMIT.py +++ b/cc/PRESUBMIT.py @@ -12,7 +12,6 @@ import re import string CC_SOURCE_FILES=(r'^cc/.*\.(cc|h)$',) -CC_PERF_TEST =(r'^.*_perftest.*\.(cc|h)$',) def CheckChangeLintsClean(input_api, output_api): input_api.cpplint._cpplint_state.ResetErrorCounts() # reset global state @@ -103,35 +102,6 @@ def CheckStdAbs(input_api, output_api, items=missing_std_prefix_files)) return result -def CheckSpamLogging(input_api, - output_api, - white_list=CC_SOURCE_FILES, - black_list=None): - black_list = tuple(black_list or input_api.DEFAULT_BLACK_LIST) - source_file_filter = lambda x: input_api.FilterSourceFile(x, - white_list, - black_list) - - log_info = [] - printf = [] - - for f in input_api.AffectedSourceFiles(source_file_filter): - contents = input_api.ReadFile(f, 'rb') - if re.search(r"\bD?LOG\s*\(\s*INFO\s*\)", contents): - log_info.append(f.LocalPath()) - if re.search(r"\bf?printf\(", contents): - printf.append(f.LocalPath()) - - if log_info: - return [output_api.PresubmitError( - 'These files spam the console log with LOG(INFO):', - items=log_info)] - if printf: - return [output_api.PresubmitError( - 'These files spam the console log with printf/fprintf:', - items=printf)] - return [] - def CheckPassByValue(input_api, output_api, white_list=CC_SOURCE_FILES, @@ -187,7 +157,6 @@ def CheckChangeOnUpload(input_api, output_api): results = [] results += CheckAsserts(input_api, output_api) results += CheckStdAbs(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) |