# git-cliff ~ configuration file
# https://git-cliff.org/docs/configuration


[changelog]
# A Tera template to be rendered for each release in the changelog.
# See https://keats.github.io/tera/docs/#introduction
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") }}
    {% for group, commits in commits | group_by(attribute="group") %}
        ### {{ group | striptags }}
        {% for commit in commits %}
            - {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
                {% if commit.breaking %}[**breaking**] {% endif %}\
                {{ commit.message | split(pat="\n") | first | upper_first }} - \
                ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\
        {% endfor %}
    {% endfor %}
{% endif %}\
"""
trim = true
render_always = true
postprocessors = []

[git]
conventional_commits = true
filter_unconventional = false
require_conventional = false
split_commits = false
commit_preprocessors = []
protect_breaking_commits = false
commit_parsers = [
    { message = "^Release|^release|^Version|^version", group = "<!-- 11 -->🏆 Tags", skip = true },
    { message = "^feat", group = "<!-- 1 -->🚀 Features" },
    { message = "^fix", group = "<!-- 2 -->🐛 Bug Fixes" },
    { message = "^doc", group = "<!-- 3 -->📚 Documentation" },
    { message = "^perf", group = "<!-- 4 -->⚡ Performance" },
    { message = "^refactor", group = "<!-- 2 -->🚜 Refactor" },
    { message = "^style", group = "<!-- 5 -->🎨 Styling" },
    { message = "^test", group = "<!-- 6 -->🧪 Testing" },
    { body = ".*security", group = "<!-- 8 -->🛡️ Security" },
    { message = "^revert", group = "<!-- 9 -->◀️ Revert" },
    { message = "^build", group = "<!-- 10 -->🏗️ Build" },
    { message = ".*", group = "<!-- 12 -->⚙️ Misc" },
]
filter_commits = false
link_parsers = []
use_branch_tags = false
topo_order = false
topo_order_commits = true
sort_commits = "oldest"
recurse_submodules = false
