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

Unified Diff: PRESUBMIT.py

Issue 2622083006: Make the SYSLOG presubmit check only check changed lines. (Closed)
Patch Set: Created 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: PRESUBMIT.py
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 2284a0f5d46ae3d8251ab9250989466623bf0c6e..36afa36e2895f564984bcb71b9abc443203643ae 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -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'
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698