Commit 032ba5bc authored by pastarmovj's avatar pastarmovj Committed by Commit bot

Make the SYSLOG presubmit check only check changed lines.

The check as it is now was spamming too many unrelated changes.
Also make output of the check more precise by showing the line
number affected.

BUG=none

Review-Url: https://codereview.chromium.org/2622083006
Cr-Commit-Position: refs/heads/master@{#443200}
parent 3988b62c
......@@ -2278,8 +2278,10 @@ def _CheckSyslogUseWarning(input_api, output_api, source_file_filter=None,
"""Checks that all source files use SYSLOG properly."""
syslog_files = []
for f in input_api.AffectedSourceFiles(source_file_filter):
if 'SYSLOG' in input_api.ReadFile(f, 'rb'):
syslog_files.append(f.LocalPath())
for line_number, line in f.ChangedContents():
if 'SYSLOG' in line:
syslog_files.append(f.LocalPath() + ':' + str(line_number))
if syslog_files:
return [output_api.PresubmitPromptWarning(
'Please make sure there are no privacy sensitive bits of data in SYSLOG'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment