Bug 1448145 [wpt PR 10147] - Fixed lint checking directories it shouldn't be, a=testonly
authorAhilya Sinha <ahilya16009@iiitd.ac.in>
Mon, 09 Apr 2018 18:05:46 +0000
changeset 413635 33c45a9dd3cae4f5898bd50dd3caa09b00bfd949
parent 413634 34bfd03e5075136aa3fc7778e49cb1f368cf881d
child 413636 1f5dac710487748cf9d2f7f3256569c644f4dbe3
push id33850
push userapavel@mozilla.com
push dateMon, 16 Apr 2018 09:53:48 +0000
treeherdermozilla-central@6276ec7ebbf3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1448145, 10147
milestone61.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 1448145 [wpt PR 10147] - Fixed lint checking directories it shouldn't be, a=testonly Automatic update from web-platform-testsFixed lint checking directories it shouldn't be (#10147) Lint earlier checked _venv/ and .git/ which it shouldn't be checking. wpt-commits: b705dc10c1b15a9cf3fa2b1648274f4d70ee1aa2 wpt-pr: 10147 wpt-commits: b705dc10c1b15a9cf3fa2b1648274f4d70ee1aa2 wpt-pr: 10147
testing/web-platform/tests/tools/gitignore/gitignore.py
testing/web-platform/tests/tools/lint/lint.py
--- a/testing/web-platform/tests/tools/gitignore/gitignore.py
+++ b/testing/web-platform/tests/tools/gitignore/gitignore.py
@@ -85,17 +85,17 @@ def parse_line(line):
     if invert:
         line = line[1:]
 
     dir_only = line[-1] == "/"
 
     if dir_only:
         line = line[:-1]
 
-    return invert, dir_only, fnmatch_translate(line, "/" in line)
+    return invert, dir_only, fnmatch_translate(line, dir_only)
 
 
 class PathFilter(object):
     def __init__(self, root, extras=None):
         if root:
             ignore_path = os.path.join(root, ".gitignore")
         else:
             ignore_path = None
--- a/testing/web-platform/tests/tools/lint/lint.py
+++ b/testing/web-platform/tests/tools/lint/lint.py
@@ -55,30 +55,29 @@ web-platform-tests directory to make the
 
 For example, to make the lint tool ignore all '%s'
 errors in the %s file,
 you could add the following line to the lint.whitelist file.
 
 %s: %s"""
 
 def all_filesystem_paths(repo_root, subdir=None):
-    path_filter = PathFilter(repo_root, extras=[".git/*"])
+    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))]
-
+                                                   repo_root)+"/")]
 
 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
     """