Bug 1428585 - Fail the wpt lint if the lint process has a non-zero exit code, r=ahal draft
authorJames Graham <james@hoppipolla.co.uk>
Mon, 08 Jan 2018 10:52:09 +0000
changeset 717748 64586867f2cd7e7968a802b3b8dd24c0f32625ad
parent 717747 721870f6c32e0ead5bf4d990dedb87e10d012ea5
child 717749 fc6cc18b513f017119905b8976d39101149c0829
push id94759
push userbmo:james@hoppipolla.co.uk
push dateTue, 09 Jan 2018 13:06:20 +0000
reviewersahal
bugs1428585
milestone59.0a1
Bug 1428585 - Fail the wpt lint if the lint process has a non-zero exit code, r=ahal MozReview-Commit-ID: GiUewbmru37
tools/lint/wpt/wpt.py
--- 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