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
This commit is contained in:
20
cliff.toml
20
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 = """
|
||||
|
||||
Reference in New Issue
Block a user