Commit edf744da authored by mark@chromium.org's avatar mark@chromium.org

Relax |const NSClass*| PRESUBMIT check to not detect false positives when

encountering Foundation types that are not id-derived, including NSPoint, 
NSRange, NSRect, and NSSize. 

BUG=77438
TEST=Modify chrome/browser/renderer_host/render_widget_host_view_mac.mm
Review URL: http://codereview.chromium.org/6755007

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@79564 0039d316-1c4b-4281-b951-d872f2087c98
parent 8062cc3a
......@@ -724,11 +724,12 @@ def _GetApprovers(messages, email_regexp, owner_regexp):
def _CheckConstNSObject(input_api, output_api, source_file_filter):
"""Checks to make sure no objective-c files have |const NSSomeClass*|."""
pattern = input_api.re.compile(r'const\s+NS\w*\s*\*')
pattern = input_api.re.compile(
r'const\s+NS(?!(Point|Range|Rect|Size)\s*\*)\w*\s*\*')
def objective_c_filter(f):
return (source_file_filter(f) and
input_api.os_path.splitext(f.LocalPath())[1] in ('.h', '.mm'))
input_api.os_path.splitext(f.LocalPath())[1] in ('.h', '.m', '.mm'))
files = []
for f in input_api.AffectedSourceFiles(objective_c_filter):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment