|
Option C Tools
|
Classes | |
| class | ChangelogEntry |
Functions | |
| list[ChangelogEntry] | collect_changelog_entries (Path repo_root, str|None since_ref=None) |
| str | format_changelog (list[ChangelogEntry] entries, str|None version=None) |
| dict | changelog_to_json (list[ChangelogEntry] entries, str|None version=None) |
Variables | |
| dict | _TYPE_TO_SECTION |
| list | _SECTION_ORDER |
Purpose
-------
Generate a Keep a Changelog formatted changelog from Conventional Commits
history (Phase 4E — G-E1).
Responsibilities
----------------
- Parse git log output into structured changelog entries.
- Map Conventional Commits types to Keep a Changelog sections.
- Render changelog in Markdown and JSON formats.
Diagnostics
-----------
Domain: GIT
Levels:
L2 — changelog generation lifecycle
L3 — entry collection details
L4 — per-commit parsing trace
Contracts
---------
- ``collect_changelog_entries`` returns an empty list on fresh repos.
- ``format_changelog`` always returns valid Markdown.
- Non-conventional commits are silently skipped (never raises).
| dict oct.git.changelog.changelog_to_json | ( | list[ChangelogEntry] | entries, |
| str | None | version = None ) |
Return structured dict for ``--json`` output.
Definition at line 205 of file changelog.py.
| list[ChangelogEntry] oct.git.changelog.collect_changelog_entries | ( | Path | repo_root, |
| str | None | since_ref = None ) |
Read git log, parse each conventional commit, return entries. Non-conventional commits are silently skipped. If *since_ref* is ``None``, the latest tag is used; if no tags exist, the entire history is scanned.
Definition at line 88 of file changelog.py.
| str oct.git.changelog.format_changelog | ( | list[ChangelogEntry] | entries, |
| str | None | version = None ) |
Render entries in Keep a Changelog format. Groups entries by section in the canonical order. If *version* is provided, the header uses ``## [version] - YYYY-MM-DD``; otherwise ``## [Unreleased]``.
Definition at line 161 of file changelog.py.
|
protected |
Definition at line 58 of file changelog.py.
|
protected |
Definition at line 48 of file changelog.py.