Bug 1428582 - Preprocess wpt lint paths to be relative to the wpt root draft
authorGeoffrey Sneddon <me@gsnedders.com>
Sat, 06 Jan 2018 23:20:08 +0000
changeset 716942 abaff3f3fb7abd72f1e029d294d00dc90b5127f6
parent 716940 36aaa86e37bac0db15a499a7f48a83bf9dff5602
child 745108 75e7a470a0f203104f93c211ca89b43a180c0cc3
push id94515
push userbmo:geoffers+mozilla@gmail.com
push dateSat, 06 Jan 2018 23:22:28 +0000
bugs1428582
milestone59.0a1
Bug 1428582 - Preprocess wpt lint paths to be relative to the wpt root MozReview-Commit-ID: EUS7sjPhWoH
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
@@ -717,17 +717,18 @@ def output_error_count(error_count):
 def changed_files(wpt_root):
     revish = testfiles.get_revish(revish=None)
     changed, _ = testfiles.files_changed(revish, set(), include_uncommitted=True, include_new=True)
     return [os.path.relpath(item, wpt_root) for item in changed]
 
 
 def lint_paths(kwargs, wpt_root):
     if kwargs.get("paths"):
-        paths = kwargs["paths"]
+        r = os.path.realpath(wpt_root)
+        paths = [os.path.relpath(os.path.realpath(x), r) for x in kwargs["paths"]]
     elif kwargs["all"]:
         paths = list(all_filesystem_paths(wpt_root))
     else:
         changed_paths = changed_files(wpt_root)
         force_all = False
         # If we changed the lint itself ensure that we retest everything
         for path in changed_paths:
             path = path.replace(os.path.sep, "/")