fonttools / fontbakery

🧁 A font quality assurance tool for everyone
https://fontbakery.readthedocs.io
Apache License 2.0
534 stars 99 forks source link

New check: Metadata has valid date #4729

Closed simoncozens closed 1 month ago

simoncozens commented 1 month ago

What needs to be checked?

If date_added is empty or malformed, things Get Bad. We should check that. Probably not as a self-contained check, but as part of something else that is checking METADATA.pb

Suggested profile

Suggest which profile the check should be added to. The most common are:

Suggested result

Which log result level should the check have:

Severity assessment

5, causes servers to fail.

felipesanches commented 1 month ago

This kind of problem happened recently in this case: https://github.com/google/fonts/pull/7694/files

felipesanches commented 1 month ago

I'm assuming here that the only acceptable format is YYYY-MM-DD

felipesanches commented 1 month ago

Even though you suggested adding this validation to some preexisting check, I opted here to create a new check because I think we should address separately and more carefully that matter of organization of (and an eventual clumping of) checks.

vv-monsalve commented 1 month ago

This had broken the push to dev, so the status for this should be ☠️ FATAL

felipesanches commented 1 month ago

Yes, @simoncozens had proposed FAIL but I actually made it FATAL.

felipesanches commented 1 month ago

https://github.com/fonttools/fontbakery/blob/687e6fa1948910b5ba4cc612e8efc4f43faf0e5d/Lib/fontbakery/checks/googlefonts/metadata.py#L84-L85

https://github.com/fonttools/fontbakery/blob/687e6fa1948910b5ba4cc612e8efc4f43faf0e5d/Lib/fontbakery/checks/googlefonts/metadata.py#L102-L106