Update documentation and scripts for font addition process; introduce uv run add-font CLI command for streamlined font management. Enhance formula generation with improved class name formatting and validation steps. Remove outdated font formula files.
This commit is contained in:
parent
69d8156b09
commit
56b64d0b34
266 changed files with 1187 additions and 8145 deletions
34
tests/test_no_orphan_formulae.py
Normal file
34
tests/test_no_orphan_formulae.py
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
"""Global tests: no orphan formulae, no duplicate formula names."""
|
||||
import pytest
|
||||
|
||||
from tests.conftest import FONT_FILES_DIR, FORMULA_DIR, get_font_dir_names
|
||||
|
||||
|
||||
def test_every_formula_has_matching_font_folder():
|
||||
"""Every Formula/font-*.rb has a matching font_files/font-<name>/ directory."""
|
||||
formula_files = sorted(FORMULA_DIR.glob("font-*.rb"))
|
||||
for formula_path in formula_files:
|
||||
name = formula_path.stem # e.g. font-acrylic-hand
|
||||
font_dir = FONT_FILES_DIR / name
|
||||
assert font_dir.is_dir(), (
|
||||
f"Orphan formula: {formula_path.name} has no matching font folder {font_dir}"
|
||||
)
|
||||
|
||||
|
||||
def test_no_duplicate_formula_names():
|
||||
"""Only one formula file per font-<name> (no duplicate basenames)."""
|
||||
formula_files = list(FORMULA_DIR.glob("font-*.rb"))
|
||||
names = [p.stem for p in formula_files]
|
||||
seen = set()
|
||||
for n in names:
|
||||
assert n not in seen, f"Duplicate formula name: {n}.rb"
|
||||
seen.add(n)
|
||||
|
||||
|
||||
def test_formula_count_matches_font_count():
|
||||
"""Number of font-*.rb formulae equals number of font-* directories."""
|
||||
font_names = get_font_dir_names()
|
||||
formula_count = len(list(FORMULA_DIR.glob("font-*.rb")))
|
||||
assert formula_count == len(font_names), (
|
||||
f"Formula count ({formula_count}) != font dir count ({len(font_names)})"
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue