Commit 914ce0a7 authored by Andrew Grieve's avatar Andrew Grieve Committed by Commit Bot

tools/licenses.py: Ignore out/ directories that use out as a prefix.

E.g. I use out-gn/, and for me this change makes licenses.py run in 1.5
seconds rather than 3 seconds.

Our .gitignore ignores all top-level out* directories, so this script
should do the same.

Bug: None
Change-Id: I78cd1fea4c23d4990d52d2d521a41fe2267a2be6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2269317Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#783011}
parent 23748d4a
......@@ -104,9 +104,7 @@ PRUNE_PATHS = set([
# Directories we don't scan through.
VCS_METADATA_DIRS = ('.svn', '.git')
PRUNE_DIRS = (VCS_METADATA_DIRS +
('out', 'Debug', 'Release', # build files
'layout_tests')) # lots of subdirs
PRUNE_DIRS = VCS_METADATA_DIRS + ('layout_tests', ) # lots of subdirs
# A third_party directory can define this file, containing a list of
# subdirectories to process in addition to itself. Intended for directories
......@@ -488,7 +486,8 @@ def FindThirdPartyDirs(prune_paths, root):
for path, dirs, files in os.walk(root):
path = path[len(root) + 1:] # Pretty up the path.
if path in prune_paths:
# .gitignore ignores /out*/, so do the same here.
if path in prune_paths or path.startswith('out'):
dirs[:] = []
continue
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment