From d333e6a4f217671ad11083a5561c83dbef2934ed Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 21 Jan 2016 19:22:04 +0501 Subject: [PATCH] servo: Merge #9394 - Include the wpt lint in test-tidy --faster (from servo:wpt-lint); r=jdm Source-Repo: https://github.com/servo/servo Source-Revision: 41892d4c93327b43dfe380a4e603789a86193069 --- servo/python/tidy.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/servo/python/tidy.py b/servo/python/tidy.py index 66303b559234..eada4fb51dde 100644 --- a/servo/python/tidy.py +++ b/servo/python/tidy.py @@ -512,11 +512,16 @@ def collect_errors_for_files(files_to_check, checking_functions, line_checking_f yield (filename,) + error -def check_wpt_lint_errors(): +def get_wpt_files(only_changed_files=False): + for f in get_file_list("./tests/wpt/web-platform-tests/", only_changed_files): + yield f[len("./tests/wpt/web-platform-tests/"):] + + +def check_wpt_lint_errors(files): wpt_working_dir = os.path.abspath(os.path.join(".", "tests", "wpt", "web-platform-tests")) site.addsitedir(wpt_working_dir) from tools.lint import lint - returncode = lint.main() + returncode = lint.lint(files) if returncode: yield ("WPT Lint Tool", "", "lint error(s) in Web Platform Tests: exit status {0}".format(returncode)) @@ -544,11 +549,7 @@ def scan(faster=False): errors = collect_errors_for_files(files_to_check, checking_functions, line_checking_functions) # wpt lint checks - if faster: - print "\033[93mUsing test-tidy \033[01m--faster\033[22m, skipping WPT lint\033[0m" - wpt_lint_errors = iter([]) - else: - wpt_lint_errors = check_wpt_lint_errors() + wpt_lint_errors = check_wpt_lint_errors(get_wpt_files(faster)) # collect errors errors = itertools.chain(errors, wpt_lint_errors)