Our SPDXMarkdown changelog format plugin currently only strips ----delimited YAML frontmatter before delegating to commitizen's built-in Markdown parser.
woile's comment on commitizen#2014 (the upstream issue that motivated this plugin) made this limitation clear:
Frontmatters come in different shapes, you are assuming --- and yaml, but those are not all the cases. We are not going to hardcode a solution that fits only your use case.
We fully agree — and that is exactly why this is a plugin rather than an upstream patch. But right now our implementation only handles one shape (--- YAML), leaving other common frontmatter formats unsupported:
- TOML frontmatter: delimited by
+++
- JSON frontmatter: delimited by
{ } (though JSON is less common in practice)
- Other custom delimiters: projects may use arbitrary markers
How to help
The core logic lives in _strip_frontmatter (standalone, no commitizen dependency). Adding support for a new format means:
- Extending
_strip_frontmatter (or adding a sibling function) to handle the new delimiter
- Creating or extending config knobs so users can select which frontmatter format to strip
- Adding tests in
tests/test_spdx_markdown.py
- Updating docs
The architecture is deliberately designed with only two override points in _SPDXMarkdownImpl — get_metadata and get_latest_full_release — so the integration surface is tiny.
See the design doc for the full class hierarchy and algorithm.
PRs welcome!
Our
SPDXMarkdownchangelog format plugin currently only strips----delimited YAML frontmatter before delegating to commitizen's built-inMarkdownparser.woile's comment on commitizen#2014 (the upstream issue that motivated this plugin) made this limitation clear:
We fully agree — and that is exactly why this is a plugin rather than an upstream patch. But right now our implementation only handles one shape (
---YAML), leaving other common frontmatter formats unsupported:+++{}(though JSON is less common in practice)How to help
The core logic lives in
_strip_frontmatter(standalone, no commitizen dependency). Adding support for a new format means:_strip_frontmatter(or adding a sibling function) to handle the new delimitertests/test_spdx_markdown.pyThe architecture is deliberately designed with only two override points in
_SPDXMarkdownImpl—get_metadataandget_latest_full_release— so the integration surface is tiny.See the design doc for the full class hierarchy and algorithm.
PRs welcome!