Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Unified Diff: tools/checkdeps/cpp_checker.py

Issue 10806049: Add checkdeps presubmit check. Warns on new #includes of dependencies (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to parent. Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/checkdeps/checkdeps.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/checkdeps/cpp_checker.py
diff --git a/tools/checkdeps/cpp_checker.py b/tools/checkdeps/cpp_checker.py
index 0f519099d52f35f4b8600910f8c83fabc771a70e..c9450c13d90901932af0718f336b8ed2743b1975 100644
--- a/tools/checkdeps/cpp_checker.py
+++ b/tools/checkdeps/cpp_checker.py
@@ -5,6 +5,7 @@
"""Checks C++ and Objective-C files for illegal includes."""
import codecs
+import os
import re
from rules import Rule
@@ -113,3 +114,10 @@ class CppChecker(object):
ret_val += line_status
return ret_val
+
+ @staticmethod
+ def IsCppFile(file_path):
+ """Returns True iff the given path ends in one of the extensions
+ handled by this checker.
+ """
+ return os.path.splitext(file_path)[1] in CppChecker.EXTENSIONS
« no previous file with comments | « tools/checkdeps/checkdeps.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698