Bug 1428585 - Fail the wpt lint if the lint process has a non-zero exit code, r=ahal
MozReview-Commit-ID: GiUewbmru37
--- a/tools/lint/wpt/wpt.py
+++ b/tools/lint/wpt/wpt.py
@@ -23,20 +23,25 @@ def lint(files, config, **kwargs):
try:
data = json.loads(line)
except ValueError:
return
data["level"] = "error"
data["path"] = os.path.relpath(os.path.join(tests_dir, data["path"]), kwargs['root'])
results.append(result.from_config(config, **data))
+ if files == [tests_dir]:
+ print >> sys.stderr, "No files specified, running the full wpt lint (this is slow)"
+ files = ["--all"]
cmd = [os.path.join(tests_dir, 'wpt'), 'lint', '--json'] + files
if platform.system() == 'Windows':
cmd.insert(0, sys.executable)
proc = ProcessHandler(cmd, env=os.environ, processOutputLine=process_line)
proc.run()
try:
proc.wait()
+ if proc.returncode != 0:
+ results.append(result.from_config(config, message="Lint process failed"))
except KeyboardInterrupt:
proc.kill()
return results