|
oct
|
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).
Dependencies
------------
- oct.core.diagnostics (_dbg structured logger)
- oct.git.conventional (parse_commit_message - each log message parsed into type and subject)
- oct.core.git (lazy; list_tags and get_commit_log - the latest tag and the commit log to scan)
| dict oct.git.changelog.changelog_to_json | ( | list[ChangelogEntry] | entries, |
| str | None | version = None ) |
Return structured dict for ``--json`` output.
Definition at line 211 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 94 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 167 of file changelog.py.
|
protected |
Definition at line 64 of file changelog.py.
|
protected |
Definition at line 54 of file changelog.py.