]> git.ipfire.org Git - thirdparty/google/fonts.git/commitdiff
Pass per-directory config file to fontbakery
authorSimon Cozens <simon@simon-cozens.org>
Thu, 18 Jan 2024 11:24:16 +0000 (11:24 +0000)
committerSimon Cozens <simon@simon-cozens.org>
Thu, 18 Jan 2024 11:24:16 +0000 (11:24 +0000)
.ci/run.py

index bc4f8961cc267966823ec0545ab7005a5e5ad7dd..5c6c18208e69f8a9842cd6fb802fd2bf311f7faa 100644 (file)
@@ -100,6 +100,12 @@ def main():
 
     for directory, check_type in directory_check_types(args.branch):
         out = os.path.join("out", os.path.basename(directory))
+        fontbakery = ["--fontbakery"]
+        fbconfig = os.path.join(directory, "fontbakery.yml")
+        if os.path.exists(fbconfig):
+            fontbakery += ["--extra-fontbakery-args=--configuration",
+                           f"--extra-fontbakery-args={fbconfig}"]
+
         fonts = glob(os.path.join(directory, "*.ttf"))
 
         qa_cmd_prefix = ["gftools", "qa", "-f"] + fonts + ["-o", out]
@@ -123,15 +129,15 @@ def main():
 
         elif check_type == CheckType.NEW_FAMILY:
             print(f"Checking new family: {directory}")
-            subprocess.run(qa_cmd_prefix + ["--fontbakery", "--interpolations"])
+            subprocess.run(qa_cmd_prefix + fontbakery + ["--interpolations"])
 
         elif check_type == CheckType.MODIFIED_FAMILY:
             print(f"Checking modified family: {directory}")
-            subprocess.run(qa_cmd_prefix + ["-gfb", "--fontbakery", "--diffenator", "--interpolations"])
+            subprocess.run(qa_cmd_prefix + ["-gfb"] + fontbakery + ["--diffenator", "--interpolations"])
 
         elif check_type == CheckType.MODIFIED_FAMILY_METADATA:
             print(f"Checking modified family metadata: {directory}")
-            subprocess.run(qa_cmd_prefix + ["--fontbakery", "-o", out])
+            subprocess.run(qa_cmd_prefix + fontbakery + ["-o", out])
 
         elif check_type == CheckType.DESIGNER:
             print(f"Checking designer profile: {directory}")