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

Unified Diff: PRESUBMIT.py

Issue 2065253003: PRESUBMIT: Fix bug in sources-above-target check. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 6 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 6d39145ca96152f9b786c85dc5336d48f7c34056..5d5a5c301a97d9e1a98b6593335b2c45d8763e64 100755
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -257,7 +257,7 @@ def _CheckNoRtcBaseDeps(input_api, gyp_files, output_api):
def _CheckNoSourcesAboveGyp(input_api, gyp_files, output_api):
# Disallow referencing source files with paths above the GYP file location.
- source_pattern = input_api.re.compile(r'sources.*?\[(.*?)\]',
+ source_pattern = input_api.re.compile(r'\'sources\'.*?\[(.*?)\]',
re.MULTILINE | re.DOTALL)
file_pattern = input_api.re.compile(r"'((\.\./.*?)|(<\(webrtc_root\).*?))'")
violating_gyp_files = set()
@@ -271,8 +271,8 @@ def _CheckNoSourcesAboveGyp(input_api, gyp_files, output_api):
for source_block_match in source_pattern.finditer(contents):
# Find all source list entries starting with ../ in the source block
# (exclude overrides entries).
- for file_list_match in file_pattern.finditer(source_block_match.group(0)):
- source_file = file_list_match.group(0)
+ for file_list_match in file_pattern.finditer(source_block_match.group(1)):
+ source_file = file_list_match.group(1)
if 'overrides/' not in source_file:
violating_source_entries.append(source_file)
violating_gyp_files.add(gyp_file)
« 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