Chromium Code Reviews| Index: tools/checkdeps/checkdeps.py |
| diff --git a/tools/checkdeps/checkdeps.py b/tools/checkdeps/checkdeps.py |
| index c08f0414542c061b256fc29ce4edc5d537f0cb95..d2a2ee02c9d7ee65ac6eaab7160d82c8b615f62f 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): |
|
M-A Ruel
2012/07/26 14:03:28
ShouldcheckIncludesInCppFile ?
Just to be clearer
|
| + """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): |
|
M-A Ruel
2012/07/26 14:03:28
I'd like to have Cpp here too but this is outside
|
| """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: |