Code style¶
Linting and formatting¶
unihan-db uses ruff for linting and formatting.
Lint the codebase:
$ uv run ruff check . --fix --show-fixes
Format the codebase:
$ uv run ruff format .
Type checking¶
mypy is configured in strict mode.
$ uv run mypy src tests
Conventions¶
from __future__ import annotationsin every module.Namespace imports for stdlib:
import typing as t.NumPy-style docstrings.
See
[tool.ruff]inpyproject.tomlfor the full rule set.