From 7b2a87944043e9ef2a07f9d984ccc6b26a8794e7 Mon Sep 17 00:00:00 2001 From: Klagarge Date: Thu, 4 Jun 2026 23:40:00 +0200 Subject: [PATCH] chore(changelog): add AI assistance mention to changelog Add a mention next to the commit message when the commit is AI assisted and group AI models used in an 'AI Assistance Repartition' section. Assisted-by: Zed:gemini-3.1-pro --- cliff.toml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/cliff.toml b/cliff.toml index 755df45..46b2e2c 100644 --- a/cliff.toml +++ b/cliff.toml @@ -25,8 +25,26 @@ body = """ - {% if commit.scope %}*({{ commit.scope }})* {% endif %}\ {% if commit.breaking %}[**breaking**] {% endif %}\ {{ commit.message | upper_first }}\ + {%- for footer in commit.footers -%} + {%- if footer.token == "Assisted-by" %} *(🤖 {{ footer.value | trim }})*{%- endif -%} + {%- endfor %}\ {% endfor %} -{% endfor %}\n +{% endfor %} + +{%- set ai_models = [] -%} +{%- for commit in commits -%} + {%- for footer in commit.footers -%} + {%- if footer.token == "Assisted-by" -%} + {%- set_global ai_models = ai_models | concat(with=footer) -%} + {%- endif -%} + {%- endfor -%} +{%- endfor -%} +{%- if ai_models | length > 0 %} + ### 🤖 AI Assistance Repartition + {%- for model, occurrences in ai_models | group_by(attribute="value") %} + - **{{ model | trim }}**: {{ occurrences | length }} commit{% if occurrences | length > 1 %}s{% endif %} + {%- endfor %} +{% endif %}\n """ # template for the changelog footer footer = """