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

Unified Diff: PRESUBMIT.py

Issue 2627023003: Add presubmit check for Google support URL format. (Closed)
Patch Set: test 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 | PRESUBMIT_test.py » ('j') | 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..e11c562bf69b935c6c92dc8fae59a4fe0039bddc 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -975,6 +975,21 @@ def _CheckForVersionControlConflicts(input_api, output_api):
'Version control conflict markers found, please resolve.', errors))
return results
+def _CheckGoogleSupportAnswerUrl(input_api, output_api):
+ pattern = input_api.re.compile('support\.google\.com\/chrome.*/answer')
+ errors = []
+ for f in input_api.AffectedFiles():
+ for line_num, line in f.ChangedContents():
+ if pattern.search(line):
+ errors.append(' %s:%d %s' % (f.LocalPath(), line_num, line))
+
+ results = []
+ if errors:
+ results.append(output_api.PresubmitPromptWarning(
+ 'Found Google support URL addressed by answer number. Please replace with '
+ 'a p= identifier instead. See crbug.com/679462\n', errors))
+ return results
+
def _CheckHardcodedGoogleHostsInLowerLayers(input_api, output_api):
def FilterFile(affected_file):
@@ -2296,6 +2311,7 @@ def CheckChangeOnUpload(input_api, output_api):
results.extend(_CheckUmaHistogramChanges(input_api, output_api))
results.extend(_AndroidSpecificOnUploadChecks(input_api, output_api))
results.extend(_CheckSyslogUseWarning(input_api, output_api))
+ results.extend(_CheckGoogleSupportAnswerUrl(input_api, output_api))
return results
« no previous file with comments | « no previous file | PRESUBMIT_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698