Skip to content

Commit

Permalink
Make the SYSLOG presubmit check only check changed lines.
Browse files Browse the repository at this point in the history
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}
  • Loading branch information
pastarmovj authored and Commit bot committed Jan 12, 2017
1 parent 3988b62 commit 032ba5b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions PRESUBMIT.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 032ba5b

Please sign in to comment.