Skip to content

Commit

Permalink
Run black, while we’re here
Browse files Browse the repository at this point in the history
  • Loading branch information
simoncozens committed Sep 1, 2023
1 parent 6e8def9 commit 52c2ef2
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions Lib/gftools/qa.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@

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

try:
from diffenator2 import ninja_diff, ninja_proof
except ModuleNotFoundError:
raise ModuleNotFoundError(("gftools was installed without the QA "
"dependencies. To install the dependencies, see the ReadMe, "
"https://github.com/googlefonts/gftools#installation"))
raise ModuleNotFoundError(
(
"gftools was installed without the QA "
"dependencies. To install the dependencies, see the ReadMe, "
"https://github.com/googlefonts/gftools#installation"
)
)

logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
Expand All @@ -25,9 +30,7 @@ def __init__(self, fonts, fonts_before=None, out="out", url=None):
def diffenator(self, **kwargs):
logger.info("Running Diffenator")
if not self.fonts_before:
logger.warning(
"Cannot run Diffenator since there are no fonts before"
)
logger.warning("Cannot run Diffenator since there are no fonts before")
return
dst = os.path.join(self.out, "Diffenator")
ninja_diff(
Expand All @@ -44,9 +47,7 @@ def diffenator(self, **kwargs):
def diffbrowsers(self, imgs=False):
logger.info("Running Diffbrowsers")
if not self.fonts_before:
logger.warning(
"Cannot run diffbrowsers since there are no fonts before"
)
logger.warning("Cannot run diffbrowsers since there are no fonts before")
return
dst = os.path.join(self.out, "Diffbrowsers")
mkdir(dst)
Expand All @@ -60,7 +61,7 @@ def diffbrowsers(self, imgs=False):
diffenator=False,
diffbrowsers=True,
)

def proof(self, imgs=False):
logger.info("Running proofing tools")
dst = os.path.join(self.out, "Proof")
Expand All @@ -77,7 +78,7 @@ def fontbakery(self, profile="googlefonts", html=False, extra_args=None):
out = os.path.join(self.out, "Fontbakery")
mkdir(out)
cmd = (
["fontbakery", "check-"+profile, "-l", "INFO", "--succinct"]
["fontbakery", "check-" + profile, "-l", "INFO", "--succinct"]
+ [f.path for f in self.fonts]
+ ["-C"]
+ ["--ghmarkdown", os.path.join(out, "report.md")]
Expand Down

0 comments on commit 52c2ef2

Please sign in to comment.