| Index: tools/checkdeps/checkdeps.py
|
| diff --git a/tools/checkdeps/checkdeps.py b/tools/checkdeps/checkdeps.py
|
| index 870e26230a7e68c487768333024385d15d9e5c01..303699c38d6564ea5c615d3cc0a24e480f8f3d26 100755
|
| --- a/tools/checkdeps/checkdeps.py
|
| +++ b/tools/checkdeps/checkdeps.py
|
| @@ -231,6 +231,11 @@ def CheckDirectory(parent_rules, checkers, dir_name):
|
| return success
|
|
|
|
|
| +def ShouldCheckAddedIncludesInFile(file_path):
|
| + """Whether to check added includes in the given file."""
|
| + return os.path.splitext(file_path)[1] in cpp_checker.CppChecker.EXTENSIONS
|
| +
|
| +
|
| def CheckAddedIncludes(added_includes):
|
| """This is used from PRESUBMIT.py to check new #include statements added in
|
| the change being presubmit checked.
|
| @@ -288,7 +293,7 @@ def CheckAddedIncludes(added_includes):
|
| problems = []
|
| for file_path, include_lines in added_includes:
|
| # TODO(joi): Make this cover Java as well.
|
| - if not os.path.splitext(file_path)[1] in cpp.EXTENSIONS:
|
| + if not ShouldCheckAddedIncludesInFile(file_path):
|
| pass
|
| rules_for_file = GetDirectoryRules(os.path.dirname(file_path))
|
| if rules_for_file:
|
|
|