Skip to content

Commit

Permalink
chore: migrate to git-cliff from changie
Browse files Browse the repository at this point in the history
Signed-off-by: wrightbradley <[email protected]>
  • Loading branch information
wrightbradley committed Dec 18, 2024
1 parent 1f56f9b commit a27538a
Show file tree
Hide file tree
Showing 10 changed files with 493 additions and 97 deletions.
6 changes: 0 additions & 6 deletions .changes/header.tpl.md

This file was deleted.

Empty file removed .changes/unreleased/.gitkeep
Empty file.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

68 changes: 0 additions & 68 deletions .changie.yaml

This file was deleted.

356 changes: 353 additions & 3 deletions CHANGELOG.md

Large diffs are not rendered by default.

140 changes: 140 additions & 0 deletions cliff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
# git-cliff ~ default configuration file
# https://git-cliff.org/docs/configuration
[remote.github]
owner = "wrightbradley"
repo = "dotfiles"

[bump]
features_always_bump_minor = false
breaking_always_bump_major = true
initial_tag = "0.1.0"

[changelog]
header = """
# Changelog\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
"""
body = """
{%- macro remote_url() -%}
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
{%- endmacro -%}
{% if version -%}
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
{% else -%}
## [Unreleased]
{% endif -%}
## What's Changed
{% for group, commits in commits | filter(attribute="merge_commit", value=false) | group_by(attribute="group") %}
### {{ group | upper_first }}
{% for commit in commits | unique(attribute="message") %}
- {{ commit.message | split(pat="\n") | first | upper_first | trim }} \
{% if commit.remote.username %} by @{{ commit.remote.username }}{%- endif -%}
{% if commit.remote.pr_number %} in \
[#{{ commit.remote.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.remote.pr_number }}) \
{%- endif %} \
- ([{{ commit.id | truncate(length=7, end="") }}]({{ commit.id }}))\
{% endfor %}
{% endfor %}
{%- if github -%}
{% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
{% raw %}\n{% endraw -%}
## New Contributors
{%- endif %}\
{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
* @{{ contributor.username }} made their first contribution
{%- if contributor.pr_number %} in \
[#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \
{%- endif %}
{%- endfor -%}
{%- endif -%}
{% if version %}
{% if previous.version %}
**Full Changelog**: {{ self::remote_url() }}/compare/{{ previous.version }}...{{ version }}
{% endif %}
{% else -%}
{% raw %}\n{% endraw %}
{% endif %}
"""
footer = """
{%- macro remote_url() -%}
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
{%- endmacro -%}
<!-- generated by git-cliff -->
"""
# {% for release in releases -%}
# {% if release.version -%}
# {% if release.previous.version -%}
# [{{ release.version | trim_start_matches(pat="v") }}]: \
# {{ self::remote_url() }}/compare/{{ release.previous.version }}..{{ release.version }}
# {% endif -%}
# {% else -%}
# [unreleased]: {{ self::remote_url() }}/compare/{{ release.previous.version }}..HEAD
# {% endif -%}
# {% endfor %}

# remove the leading and trailing spaces
trim = true
postprocessors = [
# Replace issue numbers
{ pattern = "\\[?([A-Z][A-Z0-9_]+-[1-9][0-9]*)\\]?\\s*(.*)", replace = "[$1](https://jira.atlassian.net/browse/$1) $2" },
]

[git]
# parse the commits based on https://www.conventionalcommits.org
conventional_commits = true
# filter out the commits that are not conventional
filter_unconventional = false
# process each line of a commit as an individual commit
split_commits = false
commit_preprocessors = [
# Replace issue numbers
# { pattern = "\\[?([A-Z][A-Z0-9_]+-[1-9][0-9]*)\\]?\\s*(.*)", replace = "[$1](https://jira.atlassian.net/browse/$1) $2" },
]
commit_parsers = [
{ message = "^(\\[?([A-Z][A-Z0-9_]+-[1-9][0-9]*)\\]?\\s*[Ff]eat)", group = "<!-- 0 -->🚀 Features" },
{ message = "^(\\[?([A-Z][A-Z0-9_]+-[1-9][0-9]*)\\]?\\s*[Ff]ix)", group = "<!-- 1 -->🐛 Bug Fixes" },
{ message = "^(\\[?([A-Z][A-Z0-9_]+-[1-9][0-9]*)\\]?\\s*[Rr]efactor)", group = "<!-- 2 -->🚜 Refactor" },
{ message = "^(\\[?([A-Z][A-Z0-9_]+-[1-9][0-9]*)\\]?\\s*[Bb]uild)", group = "<!-- 3 -->🔨 Build" },
{ message = "^(\\[?([A-Z][A-Z0-9_]+-[1-9][0-9]*)\\]?\\s*[Pp]erf)", group = "<!-- 4 -->⚡ Performance" },
{ message = "^(\\[?([A-Z][A-Z0-9_]+-[1-9][0-9]*)\\]?\\s*[Ss]tyle)", group = "<!-- 5 -->🎨 Styling" },
{ message = "^(\\[?([A-Z][A-Z0-9_]+-[1-9][0-9]*)\\]?\\s*[Tt]est)", group = "<!-- 6 -->🧪 Testing" },
{ message = "^(\\[?([A-Z][A-Z0-9_]+-[1-9][0-9]*)\\]?\\s*[Dd]oc)", group = "<!-- 7 -->📚 Documentation" },
{ message = "^(\\[?([A-Z][A-Z0-9_]+-[1-9][0-9]*)\\]?\\s*[Cc]hore\\(release\\): prepare for)", skip = true },
{ message = "^(\\[?([A-Z][A-Z0-9_]+-[1-9][0-9]*)\\]?\\s*[Cc]hore\\(deps.*\\))", skip = true },
{ message = "^(\\[?([A-Z][A-Z0-9_]+-[1-9][0-9]*)\\]?\\s*[Cc]hore\\(pr\\))", skip = true },
{ message = "^(\\[?([A-Z][A-Z0-9_]+-[1-9][0-9]*)\\]?\\s*[Cc]hore\\(pull\\))", skip = true },
{ message = "^(\\[?([A-Z][A-Z0-9_]+-[1-9][0-9]*)\\]?\\s*[Cc]hore)", group = "<!-- 8 -->🧹 Miscellaneous Tasks" },
{ message = "^(\\[?([A-Z][A-Z0-9_]+-[1-9][0-9]*)\\]?\\s*[Cc]i)", group = "<!-- 9 -->🤖 CI" },
{ message = "^(\\[?([A-Z][A-Z0-9_]+-[1-9][0-9]*)\\]?\\s*[Rr]evert)", group = "<!-- 10 -->◀️ Revert" },
{ message = "^[Ff]eat", group = "<!-- 0 -->🚀 Features" },
{ message = "^[Ff]ix", group = "<!-- 1 -->🐛 Bug Fixes" },
{ message = "^[Rr]efactor", group = "<!-- 2 -->🚜 Refactor" },
{ message = "^[Bb]uild", group = "<!-- 3 -->🔨 Build" },
{ message = "^[Pp]erf", group = "<!-- 4 -->⚡ Performance" },
{ message = "^[Ss]tyle", group = "<!-- 5 -->🎨 Styling" },
{ message = "^[Tt]est", group = "<!-- 6 -->🧪 Testing" },
{ message = "^[Dd]oc", group = "<!-- 7 -->📚 Documentation" },
{ message = "^[Cc]hore\\(release\\): prepare for", skip = true },
{ message = "^[Cc]hore\\(deps.*\\)", skip = true },
{ message = "^[Cc]hore\\(pr\\)", skip = true },
{ message = "^[Cc]hore\\(pull\\)", skip = true },
{ message = "^[Cc]hore", group = "<!-- 8 -->🧹 Miscellaneous Tasks" },
{ message = "^[Cc]i", group = "<!-- 9 -->🤖 CI" },
{ message = "^[Rr]evert", group = "<!-- 10 -->◀️ Revert" },
{ body = ".*[Ss]ecurity", group = "<!-- 11 -->🚨 Security" },
{ message = ".*", group = "<!-- 12 -->💼 Other" },
]
# filter out the commits that are not matched by commit parsers
filter_commits = false
topo_order = false
# sort the commits inside sections by oldest/newest order
sort_commits = "oldest"

0 comments on commit a27538a

Please sign in to comment.