computing how many numerical check IDs still remain to...
... be renamed into keyword-based IDs.
This will in the future become a hard-enforcement runtime self-test.
(issue
@@ -962,6 +962,21 @@ class Spec:
raise SetupError('Spec fails expected checks test:\n{}'.format(
'\n'.join(message)))
+ def is_numerical_id(checkid):
+ try:
+ int(checkid.split('/')[-1])
+ return True
+ except:
+ return False
+ numerical_check_ids = [c for c in registered_checks if is_numerical_id(c)]
+ if numerical_check_ids:
+ num = len(numerical_check_ids)
+ percentage = 100.0 * num / len(registered_checks)
+ print(f'\nThere still are {num} numerical check IDs. ({percentage:.2f}%)\n'
+ 'They should all be renamed to keyword-based IDs.\n'
+ 'See: https://github.com/googlefonts/fontbakery/issues/2238\n\n')
+ # assert(percentage == 0)
+
def resolve_alias(self, original_name):
name = original_name
seen = set()
