Skip to content

Commit

Permalink
Improved display of detected inconsistencies on metadata/copyright
Browse files Browse the repository at this point in the history
com.google.fonts/check/metadata/copyright
On the Google Fonts Profile.

(PR #4570)
  • Loading branch information
simoncozens authored and felipesanches committed Mar 5, 2024
1 parent e9a2f00 commit ad3dfa5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ A more detailed list of changes is available in the corresponding milestones for
- **[com.google.fonts/check/metadata/has_tags]:** Also fetch family tagging data from a second Google Sheet (Submissions from designers via form: https://forms.gle/jcp3nDv63LaV1rxH6) (PR #4576)
- **[com.google.fonts/check/metadata/broken_links]:** Added rationale. (PR #4570)
- **[com.google.fonts/check/metadata/menu_and_latin]:** Added rationale. (PR #4570)
- **[com.google.fonts/check/metadata/copyright]:** Added rationale. (PR #4570)
- **[com.google.fonts/check/metadata/copyright]:** Added rationale and improve display of detected inconsistencies. (PR #4570)

#### On the Universal profile
- **DISABLED - [com.google.fonts/check/legacy_accents]:** This is one of the checks that we probably should run on the sources instead of binaries. (https://github.com/fonttools/fontbakery/issues/3959#issuecomment-1822913547)
Expand Down
20 changes: 10 additions & 10 deletions Lib/fontbakery/checks/googlefonts/metadata.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from collections import defaultdict
import os

from fontbakery.constants import NameID, RIBBI_STYLE_NAMES
from fontbakery.prelude import check, Message, INFO, PASS, FAIL, WARN, SKIP, FATAL
from fontbakery.utils import exit_with_install_instructions
from fontbakery.utils import exit_with_install_instructions, show_inconsistencies
from fontbakery.checks.googlefonts.glyphset import can_shape


Expand Down Expand Up @@ -406,18 +407,17 @@ def com_google_fonts_check_metadata_includes_production_subsets(
for all fonts in the family.
""",
)
def com_google_fonts_check_metadata_copyright(family_metadata):
def com_google_fonts_check_metadata_copyright(family_metadata, config):
"""METADATA.pb: Copyright notice is the same in all fonts?"""
copyright_str = None
fail = False
for f in family_metadata.fonts:
if copyright_str and f.copyright != copyright_str:
fail = True
copyright_str = f.copyright
if fail:
copyrights = defaultdict(list)
for font in family_metadata.fonts:
copyrights[font.copyright].append(font.filename)
if len(copyrights) > 1:
yield FAIL, Message(
"inconsistency",
"METADATA.pb: Copyright field value is inconsistent across family",
"METADATA.pb: Copyright field value is inconsistent across the family.\n"
"The following copyright values were found:\n\n"
+ show_inconsistencies(copyrights, config),
)
else:
yield PASS, "Copyright is consistent across family"
Expand Down

0 comments on commit ad3dfa5

Please sign in to comment.