Bug 1428582 - Preprocess wpt lint paths to be relative to the wpt root
MozReview-Commit-ID: EUS7sjPhWoH
--- 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, "/")