From c98f6f368a789955f4dec5a58e0163571021ac4a Mon Sep 17 00:00:00 2001 From: "kjellander@webrtc.org" Date: Wed, 4 Mar 2015 07:08:11 +0000 Subject: [PATCH] PRESUBMIT: Exclude overrides paths from source above GYP check. Since base.gyp contains a couple of those. BUG=4185 TESTED=Ran git cl presubmit with a modified base.gyp without this patch - got errors about overrides. Ran another time with this patch applied - no errors. TBR=pthatcher@webrtc.org Review URL: https://webrtc-codereview.appspot.com/44529004 Cr-Commit-Position: refs/heads/master@{#8586} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8586 4adac7df-926f-26a2-2b94-8c16560cd09d --- PRESUBMIT.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 381119e15..90ede5136 100755 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -134,10 +134,13 @@ def _CheckNoSourcesAboveGyp(input_api, gyp_files, output_api): for gyp_file in gyp_files: contents = input_api.ReadFile(gyp_file) for source_block_match in source_pattern.finditer(contents): - # Find all source list entries starting with ../ in the source block. + # 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)): - violating_source_entries.append(file_list_match.group(0)) - violating_gyp_files.add(gyp_file) + source_file = file_list_match.group(0) + if 'overrides/' not in source_file: + violating_source_entries.append(source_file) + violating_gyp_files.add(gyp_file) if violating_gyp_files: return [output_api.PresubmitError( 'Referencing source files above the directory of the GYP file is not '