From a9fc0f3609ff7a7365bd90ccdb34df9db3e45b31 Mon Sep 17 00:00:00 2001 From: Tiago Peczenyj Date: Mon, 25 May 2026 16:41:34 +0200 Subject: [PATCH 1/2] chore: standardize git-cliff config with sibling repos Adopt the shared structalign-based cliff.toml: Keep a Changelog header, full section set (Added/Changed/Deprecated/Removed/Fixed/Security/ Documentation), footer compare/tree URLs, prose fallbacks, breaking and scope markers. Adds a "^Merge" skip so merge commits never leak into the changelog. Co-Authored-By: Claude Opus 4.7 --- CHANGELOG.md | 6 +++ cliff.toml | 121 +++++++++++++++++++++++++++++++-------------------- 2 files changed, 80 insertions(+), 47 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 119f907..c2147f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## [Unreleased] + +### Changed + +- Adopt the shared Keep a Changelog git-cliff configuration + ## [0.6.0] - 2026-05-25 ### Features diff --git a/cliff.toml b/cliff.toml index 20ead24..a4a2a55 100644 --- a/cliff.toml +++ b/cliff.toml @@ -1,71 +1,98 @@ -# git-cliff configuration file +# git-cliff ~ configuration file # https://git-cliff.org/docs/configuration +# +# Generates a "Keep a Changelog"-style CHANGELOG.md from Conventional Commits. +# Section order follows keepachangelog.com: Added, Changed, Deprecated, +# Removed, Fixed, Security (Documentation is appended as an extra section). +# The "" prefixes on group names only control ordering; they are +# stripped from the rendered headings via the `striptags` filter. [changelog] -# changelog header header = """ # Changelog\n -All notable changes to this project will be documented in this file.\n +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n """ -# template for the changelog body -# https://keats.github.io/tera/docs/#introduction body = """ -{% if version %}\ +{% if version -%} ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} -{% else %}\ - ## [unreleased] -{% endif %}\ +{% else -%} + ## [Unreleased] +{% endif -%} {% for group, commits in commits | group_by(attribute="group") %} - ### {{ group | upper_first }} + ### {{ group | striptags | trim | upper_first }} {% for commit in commits %} - - {% if commit.scope %}*({{ commit.scope }})* {% endif %}{{ commit.message | upper_first }}\ + - {% if commit.scope %}*({{ commit.scope }})* {% endif %}\ + {% if commit.breaking %}[**breaking**] {% endif %}\ + {{ commit.message | split(pat="\n") | first | upper_first | trim }}\ {% endfor %} {% endfor %}\n """ -# template for the changelog footer footer = """ +{% for release in releases -%} + {% if release.version -%} + {% if release.previous.version -%} + [{{ release.version | trim_start_matches(pat="v") }}]: \ + https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}\ + /compare/{{ release.previous.version }}..{{ release.version }} + {% else -%} + [{{ release.version | trim_start_matches(pat="v") }}]: \ + https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}\ + /tree/{{ release.version }} + {% endif -%} + {% else -%} + {% if release.previous.version -%} + [unreleased]: https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}\ + /compare/{{ release.previous.version }}..HEAD + {% else -%} + [unreleased]: https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}\ + /commits + {% endif -%} + {% endif -%} +{% endfor %} """ -# remove the leading and trailing whitespace from the templates trim = true +# Pin the remote explicitly so the footer's compare/tree links are +# deterministic. Auto-detection from the origin URL can fail transiently +# (e.g. a remote/API lookup hiccup during `task release`), which renders the +# owner/repo as empty and produces broken `https://github.com///compare/...` +# links. +[remote.github] +owner = "peczenyj" +repo = "xpool" + [git] -# parse the commits based on https://www.conventionalcommits.org conventional_commits = true -# filter out the commits that are not conventional +# Keep non-conventional commits too; the prose fallbacks below route them. filter_unconventional = false -# process each line of a commit as an individual commit -split_commits = false -# regex for preprocessing the commit messages -commit_preprocessors = [ - # { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/peczenyj/xpool/issues/${2}))"}, # replace issue numbers -] -# regex for parsing and grouping commits -commit_parsers = [ - { message = "^feat", group = "Features" }, - { message = "^fix", group = "Bug Fixes" }, - { message = "^doc", group = "Documentation" }, - { message = "^perf", group = "Performance" }, - { message = "^refactor", group = "Refactor" }, - { message = "^style", group = "Styling" }, - { message = "^test", group = "Testing" }, - { message = "^chore\\(release\\): prepare for", skip = true }, - { message = "^chore", group = "Miscellaneous Tasks" }, - { body = ".*security", group = "Security" }, -] -# protect breaking changes from being skipped due to matching a skipping commit_parser -protect_breaking_commits = false -# filter out the commits that are not matched by commit_parsers filter_commits = false -# glob pattern for matching git tags -tag_pattern = "v[0-9]*" -# regex for skipping tags -skip_tags = "" -# regex for ignoring tags -ignore_tags = "" -# sort the tags topologically topo_order = false -# sort the commits inside sections by message sort_commits = "oldest" -# limit the number of commits included in the changelog. -# limit_commits = 100 +commit_parsers = [ + # Drop merge commits so they never leak into the changelog. + { message = "^Merge", skip = true }, + # --- Conventional Commit types (preferred) --- + { message = "^feat", group = "Added" }, + { message = "^perf", group = "Changed" }, + { message = "^refactor", group = "Changed" }, + { message = "^style", group = "Changed" }, + { message = "^revert", group = "Changed" }, + { message = "^deprecat", group = "Deprecated" }, + { message = "^remove", group = "Removed" }, + { message = "^fix", group = "Fixed" }, + { message = "^security", group = "Security" }, + { message = "^docs", group = "Documentation" }, + # Housekeeping types are not user-facing: keep them out of the changelog. + { message = "^(chore|ci|build|test)(\\(|:|!)", skip = true }, + # --- Prose fallbacks for non-conventional history --- + { message = "^[Ii]nitial", group = "Added" }, + { message = "^([Aa]dd|[Ss]upport)", group = "Added" }, + { message = "^.*: ([Aa]dd|[Ss]upport)", group = "Added" }, + { message = "^[Rr]emove", group = "Removed" }, + { message = "^([Ff]ix|.*: [Ff]ix)", group = "Fixed" }, + { message = ".*", group = "Changed" }, +] From 08449da3356f7547251282f82b770276b9a80047 Mon Sep 17 00:00:00 2001 From: Tiago Peczenyj Date: Mon, 25 May 2026 16:54:00 +0200 Subject: [PATCH 2/2] docs: add per-version comparison links to CHANGELOG Co-Authored-By: Claude Opus 4.7 --- CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c2147f2..393743a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -77,4 +77,17 @@ All notable changes to this project will be documented in this file. ## [0.0.1] - 2024-06-24 +[unreleased]: https://github.com/peczenyj/xpool/compare/v0.6.0..HEAD +[0.6.0]: https://github.com/peczenyj/xpool/compare/v0.5.2..v0.6.0 +[0.5.2]: https://github.com/peczenyj/xpool/compare/v0.5.1..v0.5.2 +[0.5.1]: https://github.com/peczenyj/xpool/compare/v0.5.0..v0.5.1 +[0.5.0]: https://github.com/peczenyj/xpool/compare/v0.4.1..v0.5.0 +[0.4.1]: https://github.com/peczenyj/xpool/compare/v0.4.0..v0.4.1 +[0.4.0]: https://github.com/peczenyj/xpool/compare/v0.3.0..v0.4.0 +[0.3.0]: https://github.com/peczenyj/xpool/compare/v0.2.0..v0.3.0 +[0.2.0]: https://github.com/peczenyj/xpool/compare/v0.1.1..v0.2.0 +[0.1.1]: https://github.com/peczenyj/xpool/compare/v0.1.0..v0.1.1 +[0.1.0]: https://github.com/peczenyj/xpool/compare/v0.0.1..v0.1.0 +[0.0.1]: https://github.com/peczenyj/xpool/tree/v0.0.1 +