mirror of
https://github.com/servo/servo.git
synced 2025-06-06 00:25:37 +00:00
Auto merge of #8742 - jmr0:master, r=Ms2ger
adding wpt lint script to tidy checks Fixes #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 -->
This commit is contained in:
commit
a8cbc28643
1 changed files with 12 additions and 2 deletions
|
@ -544,6 +544,16 @@ def check_reftest_html_files_in_basic_list(reftest_dir):
|
|||
yield (file_path, "", "not found in basic.list")
|
||||
|
||||
|
||||
def check_wpt_lint_errors():
|
||||
import subprocess
|
||||
wpt_working_dir = os.path.abspath(os.path.join(".", "tests", "wpt", "web-platform-tests"))
|
||||
lint_cmd = os.path.join(wpt_working_dir, "lint")
|
||||
try:
|
||||
subprocess.check_call(lint_cmd, cwd=wpt_working_dir) # Must run from wpt's working dir
|
||||
except subprocess.CalledProcessError as e:
|
||||
yield ("WPT Lint Tool", "", "lint error(s) in Web Platform Tests: exit status {0}".format(e.returncode))
|
||||
|
||||
|
||||
def scan():
|
||||
all_files = (os.path.join(r, f) for r, _, files in os.walk(".") for f in files)
|
||||
files_to_check = filter(should_check, all_files)
|
||||
|
@ -556,9 +566,9 @@ def scan():
|
|||
reftest_to_check = filter(should_check_reftest, reftest_files)
|
||||
r_errors = check_reftest_order(reftest_to_check)
|
||||
not_found_in_basic_list_errors = check_reftest_html_files_in_basic_list(reftest_dir)
|
||||
wpt_lint_errors = check_wpt_lint_errors()
|
||||
|
||||
errors = list(itertools.chain(errors, r_errors, not_found_in_basic_list_errors))
|
||||
|
||||
errors = list(itertools.chain(errors, r_errors, not_found_in_basic_list_errors, wpt_lint_errors))
|
||||
if errors:
|
||||
for error in errors:
|
||||
print "\033[94m{}\033[0m:\033[93m{}\033[0m: \033[91m{}\033[0m".format(*error)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue