diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-10-31 10:29:10 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-31 10:29:10 -0500 |
commit | cb8ac3f00cf3c55a17dadc68d9287c6cd7c92e1c (patch) | |
tree | 6a489579b3fc7ecd28d4a3131e200d967d5bedc1 /python/tidy | |
parent | 5916b0817488d72eb7f33cea83eed825c30d5a79 (diff) | |
parent | 2ff0f33b2b1caaef6d2b504ccc5f04f401418f86 (diff) | |
download | servo-cb8ac3f00cf3c55a17dadc68d9287c6cd7c92e1c.tar.gz servo-cb8ac3f00cf3c55a17dadc68d9287c6cd7c92e1c.zip |
Auto merge of #13999 - servo:tidy-wpt, r=Wafflespeanut
Reinstate the wpt lint checking.
<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13999)
<!-- Reviewable:end -->
Diffstat (limited to 'python/tidy')
-rw-r--r-- | python/tidy/servo_tidy/tidy.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/python/tidy/servo_tidy/tidy.py b/python/tidy/servo_tidy/tidy.py index 1dcbd4896d1..a8e53d7804e 100644 --- a/python/tidy/servo_tidy/tidy.py +++ b/python/tidy/servo_tidy/tidy.py @@ -782,8 +782,8 @@ def collect_errors_for_files(files_to_check, checking_functions, line_checking_f yield (filename,) + error -def get_wpt_files(only_changed_files, progress): - wpt_dir = os.path.join(".", "tests", "wpt" + os.sep) +def get_wpt_files(suite, only_changed_files, progress): + wpt_dir = os.path.join(".", "tests", "wpt", suite, "") file_iter = get_file_list(os.path.join(wpt_dir), only_changed_files) (has_element, file_iter) = is_iter_empty(file_iter) if not has_element: @@ -796,12 +796,13 @@ def get_wpt_files(only_changed_files, progress): yield f[len(wpt_dir):] -def check_wpt_lint_errors(files): +def check_wpt_lint_errors(suite, files): wpt_working_dir = os.path.abspath(os.path.join(".", "tests", "wpt", "web-platform-tests")) if os.path.isdir(wpt_working_dir): site.addsitedir(wpt_working_dir) from tools.lint import lint - returncode = lint.lint(wpt_working_dir, files, output_json=False) + file_dir = os.path.abspath(os.path.join(".", "tests", "wpt", suite)) + returncode = lint.lint(file_dir, files, output_json=False) if returncode: yield ("WPT Lint Tool", "", "lint error(s) in Web Platform Tests: exit status {0}".format(returncode)) @@ -865,9 +866,12 @@ def scan(only_changed_files=False, progress=True): # check dependecy licenses dep_license_errors = check_dep_license_errors(get_dep_toml_files(only_changed_files), progress) # wpt lint checks - wpt_lint_errors = check_wpt_lint_errors(get_wpt_files(only_changed_files, progress)) + wpt_lint_errors = [ + check_wpt_lint_errors(suite, get_wpt_files(suite, only_changed_files, progress)) + for suite in ["web-platform-tests", os.path.join("mozilla", "tests")] + ] # chain all the iterators - errors = itertools.chain(config_errors, directory_errors, file_errors, dep_license_errors, wpt_lint_errors) + errors = itertools.chain(config_errors, directory_errors, file_errors, dep_license_errors, *wpt_lint_errors) error = None for error in errors: |