Skip to content

Commit a8cbc28

Browse files
author
bors-servo
committed
Auto merge of servo#8742 - jmr0:master, r=Ms2ger
adding wpt lint script to tidy checks Fixes servo#8285. Tidy check will fail, however, until we merge the latest https://github.com/w3c/web-platform-tests/blob/master/lint.whitelist <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8742) <!-- Reviewable:end -->
2 parents 6510834 + e301ff4 commit a8cbc28

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

python/tidy.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,16 @@ def check_reftest_html_files_in_basic_list(reftest_dir):
544544
yield (file_path, "", "not found in basic.list")
545545

546546

547+
def check_wpt_lint_errors():
548+
import subprocess
549+
wpt_working_dir = os.path.abspath(os.path.join(".", "tests", "wpt", "web-platform-tests"))
550+
lint_cmd = os.path.join(wpt_working_dir, "lint")
551+
try:
552+
subprocess.check_call(lint_cmd, cwd=wpt_working_dir) # Must run from wpt's working dir
553+
except subprocess.CalledProcessError as e:
554+
yield ("WPT Lint Tool", "", "lint error(s) in Web Platform Tests: exit status {0}".format(e.returncode))
555+
556+
547557
def scan():
548558
all_files = (os.path.join(r, f) for r, _, files in os.walk(".") for f in files)
549559
files_to_check = filter(should_check, all_files)
@@ -556,9 +566,9 @@ def scan():
556566
reftest_to_check = filter(should_check_reftest, reftest_files)
557567
r_errors = check_reftest_order(reftest_to_check)
558568
not_found_in_basic_list_errors = check_reftest_html_files_in_basic_list(reftest_dir)
569+
wpt_lint_errors = check_wpt_lint_errors()
559570

560-
errors = list(itertools.chain(errors, r_errors, not_found_in_basic_list_errors))
561-
571+
errors = list(itertools.chain(errors, r_errors, not_found_in_basic_list_errors, wpt_lint_errors))
562572
if errors:
563573
for error in errors:
564574
print "\033[94m{}\033[0m:\033[93m{}\033[0m: \033[91m{}\033[0m".format(*error)

0 commit comments

Comments
 (0)