Skip to content

Commit

Permalink
Merge pull request #800 from googlefonts/qa-err-code
Browse files Browse the repository at this point in the history
qa: return errcode 1 if fontbakery reports a fatal error
  • Loading branch information
m4rc1e authored Jan 3, 2024
2 parents c4eaefa + ffaf8e5 commit 91939f9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Lib/gftools/qa.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from gftools.gfgithub import GitHubClient
from gftools.utils import mkdir
import sys

try:
from diffenator2 import ninja_diff, ninja_proof
Expand Down Expand Up @@ -114,12 +115,13 @@ def fontbakery(self, profile="googlefonts", html=False, extra_args=None):
+ [f.path for f in self.fonts]
+ ["-C"]
+ ["--ghmarkdown", os.path.join(out, "report.md")]
+ ["-e", "FATAL"]
)
if html:
cmd.extend(["--html", os.path.join(out, "report.html")])
if extra_args:
cmd.extend(extra_args)
subprocess.call(cmd)
process = subprocess.run(cmd)

fontbakery_report = os.path.join(self.out, "Fontbakery", "report.md")
if not os.path.isfile(fontbakery_report):
Expand All @@ -131,6 +133,10 @@ def fontbakery(self, profile="googlefonts", html=False, extra_args=None):
msg = doc.read()
self.post_to_github(msg)

if process.returncode != 0:
logger.fatal("Fontbakery has raised a fatal error. Please fix!")
sys.exit(1)

def googlefonts_upgrade(self, imgs=False):
self.fontbakery()
self.diffenator()
Expand Down

0 comments on commit 91939f9

Please sign in to comment.