RenderCV codebase architecture, source code standards, and project references. Use when writing or reviewing RenderCV code.
Every function, variable, and class attribute must be strictly typed. No exceptions.
Use modern Python 3.12+ syntax:
type statement[T], [**P])str | int, not Union[str, int])str | None, not Optional[str])Always run just check and just format before committing. just check must show zero errors:
just format
just check
If there's absolutely no alternative, use # ty: ignore[error-code] or #NOQA: error-code to ignore typing or linting errors.
Use Google-style docstrings. Include a "Why" section and "Example" section when it adds value:
def resolve_relative_path(
path: pathlib.Path, info: pydantic.ValidationInfo, must_exist: bool = True
) -> pathlib.Path:
"""Convert relative path to absolute path based on input file location.
Why:
Users reference files like `photo: profile.jpg` relative to their CV
YAML. This validator resolves such paths to absolute form and validates
existence, enabling file access during rendering.
Args:
path: Path to resolve (may be relative or absolute).
info: Validation context containing input file path.
must_exist: Whether to raise error if path doesn't exist.
Returns:
Absolute path.
"""
Docstring order: