diff options
-rw-r--r-- | DEPS | 10 | ||||
-rw-r--r-- | breakpad/DEPS | 1 | ||||
-rw-r--r-- | sdch/DEPS | 1 | ||||
-rw-r--r-- | skia/DEPS | 2 | ||||
-rw-r--r-- | testing/DEPS | 2 | ||||
-rw-r--r-- | tools/checkdeps/checkdeps.py | 31 | ||||
-rw-r--r-- | webkit/DEPS | 4 | ||||
-rw-r--r-- | webkit/build/JavaScriptCore/DEPS | 2 |
8 files changed, 29 insertions, 24 deletions
@@ -30,3 +30,13 @@ include_rules = [ # this should probably change. "+unicode" ] + +# checkdeps.py shouldn't check include paths for files in these dirs: +skip_child_includes = [ + "breakpad", + "sdch", + "skia", + "testing", + "third_party", + "v8", +] diff --git a/breakpad/DEPS b/breakpad/DEPS deleted file mode 100644 index ad8101f..0000000 --- a/breakpad/DEPS +++ /dev/null @@ -1 +0,0 @@ -skip_subtree_includes = True diff --git a/sdch/DEPS b/sdch/DEPS deleted file mode 100644 index ad8101f..0000000 --- a/sdch/DEPS +++ /dev/null @@ -1 +0,0 @@ -skip_subtree_includes = True diff --git a/skia/DEPS b/skia/DEPS deleted file mode 100644 index fe0a5d2..0000000 --- a/skia/DEPS +++ /dev/null @@ -1,2 +0,0 @@ -# Don't check include rules for Skia. -skip_subtree_includes = True diff --git a/testing/DEPS b/testing/DEPS deleted file mode 100644 index af64546..0000000 --- a/testing/DEPS +++ /dev/null @@ -1,2 +0,0 @@ -# Prevent the include rule checker from checking gtest. -skip_subtree_includes = True diff --git a/tools/checkdeps/checkdeps.py b/tools/checkdeps/checkdeps.py index 8d5aff4..ab0915a 100644 --- a/tools/checkdeps/checkdeps.py +++ b/tools/checkdeps/checkdeps.py @@ -56,11 +56,6 @@ import optparse import re import sys -# Variable name used in the DEPS file. Its presence tells us not to check -# the sub-tree. For example, third_party directories would use this, where we -# have no control over their includes. -SKIP_VAR_NAME = "skip_subtree_includes" - # Variable name used in the DEPS file to specify module-level deps. DEPS_VAR_NAME = "deps" @@ -68,6 +63,10 @@ DEPS_VAR_NAME = "deps" # the module-level deps. INCLUDE_RULES_VAR_NAME = "include_rules" +# Optionally present in the DEPS file to list subdirectories which should not +# be checked. This allows us to skip third party code, for example. +SKIP_SUBDIRS_VAR_NAME = "skip_child_includes" + # We'll search for lines beginning with this string for checking. INCLUDE_PREFIX = "#include" @@ -227,12 +226,14 @@ def ApplyDirectoryRules(existing_rules, dir_name): dir_name: The directory name that the deps file may live in (if it exists). This will also be used to generate the implicit rules. - Returns: The combined set of rules to apply to the sub-tree. + Returns: A tuple containing: (1) the combined set of rules to apply to the + sub-tree, and (2) a list of all subdirectories that should NOT be + checked, as specified in the DEPS file (if any). """ # Check for a .svn directory in this directory. This will tell us if it's # a source directory and should be checked. if not os.path.exists(os.path.join(dir_name, ".svn")): - return None + return (None, []) # Check the DEPS file in this directory. if VERBOSE: @@ -244,20 +245,16 @@ def ApplyDirectoryRules(existing_rules, dir_name): if not os.path.exists(deps_file): if VERBOSE: print " No deps file found in", dir_name - return existing_rules # Nothing to change from the input rules. + return (existing_rules, []) # Nothing to change from the input rules. execfile(deps_file, scope) - # Check the "skip" flag to see if we should check this directory at all. - if scope.get(SKIP_VAR_NAME): - if VERBOSE: - print " Deps file specifies skipping this directory." - return None - deps = scope.get(DEPS_VAR_NAME, {}) include_rules = scope.get(INCLUDE_RULES_VAR_NAME, []) + skip_subdirs = scope.get(SKIP_SUBDIRS_VAR_NAME, []) - return ApplyRules(existing_rules, deps, include_rules, dir_name) + return (ApplyRules(existing_rules, deps, include_rules, dir_name), + skip_subdirs) def ShouldCheckFile(file_name): @@ -339,7 +336,7 @@ def CheckFile(rules, file_name): def CheckDirectory(rules, dir_name): - rules = ApplyDirectoryRules(rules, dir_name) + (rules, skip_subdirs) = ApplyDirectoryRules(rules, dir_name) if rules == None: return True @@ -349,6 +346,8 @@ def CheckDirectory(rules, dir_name): success = True contents = os.listdir(dir_name) for cur in contents: + if cur in skip_subdirs: + continue # Don't check children that DEPS has asked us to skip. full_name = os.path.join(dir_name, cur) if os.path.isdir(full_name): dirs_to_check.append(full_name) diff --git a/webkit/DEPS b/webkit/DEPS new file mode 100644 index 0000000..ffded95 --- /dev/null +++ b/webkit/DEPS @@ -0,0 +1,4 @@ +# checkdeps.py shouldn't check include paths for files in these dirs:
+skip_child_includes = [
+ "build",
+]
diff --git a/webkit/build/JavaScriptCore/DEPS b/webkit/build/JavaScriptCore/DEPS deleted file mode 100644 index b732c5f..0000000 --- a/webkit/build/JavaScriptCore/DEPS +++ /dev/null @@ -1,2 +0,0 @@ -# Don't check the includes here, since we include various WebKit things. -skip_subtree_includes = True |