Include the wpt lint in test-tidy --faster.

This commit is contained in:
Ms2ger 2016-01-18 16:44:06 +01:00 committed by Ms2ger
parent a86035dc6d
commit aa1ae9b355

View file

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