run check 028 (font has a license) only once per project
(issue
@@ -322,12 +322,13 @@ def check_font_has_post_table_version_2(fb, ttFont):
@register_condition
@condition
-def licenses(font):
- """Get license path"""
+def licenses(fonts):
+ """Get a list of paths for every license
+ file found in a font project."""
licenses = []
- file_path = os.path.dirname(font)
+ font_project_path = os.path.dirname(fonts[0])
for license in ['OFL.txt', 'LICENSE.txt']:
- license_path = os.path.join(file_path, license)
+ license_path = os.path.join(font_project_path, license)
if os.path.exists(license_path):
licenses.append(license_path)
return licenses
@@ -346,7 +347,7 @@ def license(licenses):
id='com.google.fonts/test/028'
)
def check_font_has_a_license(fb, licenses):
- """Check font has a license"""
+ """Check font project has a license"""
if len(licenses) > 1:
fb.error("More than a single license file found."
" Please review.")
