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
This commit is contained in:
Ms2ger 2016-01-21 19:22:04 +05:01
Родитель cfc23bc6fb
Коммит d333e6a4f2
1 изменённых файлов: 8 добавлений и 7 удалений

Просмотреть файл

@ -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)