| Index: PRESUBMIT.py
|
| diff --git a/PRESUBMIT.py b/PRESUBMIT.py
|
| index 33d75410d653d3d2a9879cb4339b432783752e47..d78629a6d802bea59f45596784536cb99aeb33a9 100644
|
| --- a/PRESUBMIT.py
|
| +++ b/PRESUBMIT.py
|
| @@ -1582,34 +1582,6 @@
|
| 'false. The mode is deprecated and will be removed soon.',
|
| files)]
|
| return []
|
| -
|
| -
|
| -def _CheckUselessForwardDeclarations(input_api, output_api):
|
| - """Checks that affected header files do not contain useless class
|
| - or struct forward declaration.
|
| - """
|
| - results = []
|
| - class_pattern = input_api.re.compile(r'^class\s+(\w+);$',
|
| - input_api.re.MULTILINE)
|
| - struct_pattern = input_api.re.compile(r'^struct\s+(\w+);$',
|
| - input_api.re.MULTILINE)
|
| - for f in input_api.AffectedFiles():
|
| - if not f.LocalPath().endswith('.h'):
|
| - continue
|
| -
|
| - contents = input_api.ReadFile(f)
|
| - fwd_decls = input_api.re.findall(class_pattern, contents)
|
| - fwd_decls.extend(input_api.re.findall(struct_pattern, contents))
|
| -
|
| - for decl in fwd_decls:
|
| - count = sum(1 for _ in input_api.re.finditer(
|
| - r'\b%s\b' % input_api.re.escape(decl), contents))
|
| - if count == 1:
|
| - results.append(output_api.PresubmitPromptWarning(
|
| - '%s: %s forward declaration seems to be useless' %
|
| - (f.LocalPath(), decl)))
|
| -
|
| - return results
|
|
|
|
|
| def _CheckAndroidToastUsage(input_api, output_api):
|
| @@ -2061,7 +2033,6 @@
|
| results.extend(_CheckJavaStyle(input_api, output_api))
|
| results.extend(_CheckIpcOwners(input_api, output_api))
|
| results.extend(_CheckMojoUsesNewWrapperTypes(input_api, output_api))
|
| - results.extend(_CheckUselessForwardDeclarations(input_api, output_api))
|
|
|
| if any('PRESUBMIT.py' == f.LocalPath() for f in input_api.AffectedFiles()):
|
| results.extend(input_api.canned_checks.RunUnitTestsInDirectory(
|
|
|