Skip to content

Commit 6a6a504

Browse files
mpcabdclaude
andcommitted
Complete remaining plan items: coverage and type hints
- Wire pytest-cov into addopts so `uv run pytest` always reports coverage - Add type hints to auto_config() and config_for_true_type_font() Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent a51c83d commit 6a6a504

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

arabic_reshaper/reshaper_config.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,10 @@ class ArabicReshaperConfigurationError(ValueError):
365365
}
366366

367367

368-
def auto_config(configuration=None, configuration_file=None):
368+
def auto_config(
369+
configuration: dict | None = None,
370+
configuration_file: str | None = None,
371+
):
369372
loaded_from_envvar = False
370373

371374
configuration_parser = ConfigParser()
@@ -405,7 +408,7 @@ def auto_config(configuration=None, configuration_file=None):
405408
return configuration_parser['ArabicReshaper']
406409

407410

408-
def config_for_true_type_font(font_file_path, ligatures_config=ENABLE_ALL_LIGATURES):
411+
def config_for_true_type_font(font_file_path: str, ligatures_config: int = ENABLE_ALL_LIGATURES) -> dict:
409412
"""Return a reshaper configuration dict tuned to the capabilities of a TrueType font.
410413
411414
Inspects the font's cmap table to determine which positional Arabic letter

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ exclude = ["arabic_reshaper/tests"]
4242

4343
[tool.pytest.ini_options]
4444
testpaths = ["arabic_reshaper/tests"]
45+
addopts = "--cov=arabic_reshaper --cov-report=term-missing"
4546

4647
[tool.uv]
4748
package = true

0 commit comments

Comments
 (0)