diff options
author | jmr0 <jrosello720@gmail.com> | 2015-11-29 20:51:55 -0500 |
---|---|---|
committer | jmr0 <jrosello720@gmail.com> | 2015-11-30 10:08:10 -0500 |
commit | e301ff46b2ab1dc823489fd979e64bc04c931aed (patch) | |
tree | 6f97f15ea2274a3733053c4332ea439c596a7d2d | |
parent | 29c42a9f78a20ddeb5aa89b79d578a039c087967 (diff) | |
download | servo-e301ff46b2ab1dc823489fd979e64bc04c931aed.tar.gz servo-e301ff46b2ab1dc823489fd979e64bc04c931aed.zip |
adding wpt lint script to tidy checks
-rw-r--r-- | python/tidy.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/python/tidy.py b/python/tidy.py index af79f66b3b4..6f8b023f5cb 100644 --- a/python/tidy.py +++ b/python/tidy.py @@ -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) |