Bug 1497898 - Update the lint to the new gitignore API, r=ato
☠☠ backed out by fe1c2bb6cfbc ☠ ☠
authorJames Graham <james@hoppipolla.co.uk>
Wed, 10 Oct 2018 17:51:23 +0000
changeset 500622 184bc31c33a6edba5ddb13d1daef81c39f87370f
parent 500621 c3cb0408498cd890dba6038de0debf247ba03324
child 500623 48be184d5377dd0aee94eca7ef5a3c4d369069c1
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato
bugs1497898
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1497898 - Update the lint to the new gitignore API, r=ato Depends on D8224 Differential Revision: https://phabricator.services.mozilla.com/D8225
testing/web-platform/tests/tools/lint/lint.py
--- a/testing/web-platform/tests/tools/lint/lint.py
+++ b/testing/web-platform/tests/tools/lint/lint.py
@@ -11,16 +11,17 @@ import sys
 import tempfile
 
 from collections import defaultdict
 
 from . import fnmatch
 from .. import localpaths
 from ..gitignore.gitignore import PathFilter
 from ..wpt import testfiles
+from ..manifest.vcs import walk
 
 from manifest.sourcefile import SourceFile, js_meta_re, python_meta_re, space_chars, get_any_variants, get_default_any_variants
 from six import binary_type, iteritems, itervalues
 from six.moves import range
 from six.moves.urllib.parse import urlsplit, urljoin
 
 import logging
 
@@ -62,24 +63,21 @@ you could add the following line to the 
 %s: %s"""
 
 def all_filesystem_paths(repo_root, subdir=None):
     path_filter = PathFilter(repo_root, extras=[".git/"])
     if subdir:
         expanded_path = subdir
     else:
         expanded_path = repo_root
-    for dirpath, dirnames, filenames in os.walk(expanded_path):
-        for filename in filenames:
-            path = os.path.relpath(os.path.join(dirpath, filename), repo_root)
-            if path_filter(path):
-                yield path
-        dirnames[:] = [item for item in dirnames if
-                       path_filter(os.path.relpath(os.path.join(dirpath, item) + "/",
-                                                   repo_root)+"/")]
+    for dirpath, dirnames, filenames in path_filter(walk(expanded_path)):
+        for filename, _ in filenames:
+            path = os.path.join(dirpath, filename)
+            yield path
+
 
 def _all_files_equal(paths):
     """
     Checks all the paths are files that are byte-for-byte identical
 
     :param paths: the list of paths to compare
     :returns: True if they are all identical
     """