# This git-cliff configuration file is used to generate weekly reports for This
# Week in Matrix amongst others.

[changelog]
header = """
# This Week in the Matrix Rust SDK ({{ now() | date(format="%Y-%m-%d") }})
"""
body = """
{% for commit in commits %}
    {% set_global commit_message = commit.message -%}
    {% for footer in commit.footers -%}
        {% if footer.token | lower  == "changelog" -%}
            {% set_global commit_message = footer.value -%}
        {% elif footer.token | lower  == "breaking-change" -%}
            {% set_global commit_message = footer.value -%}
        {% endif -%}
    {% endfor -%}
    - {{ commit_message | upper_first }}
{% endfor %}
"""
trim = true
footer = ""

[git]
conventional_commits = true
filter_unconventional = true
commit_preprocessors = [
    { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/matrix-org/matrix-rust-sdk/pull/${2}))"},
]
commit_parsers = [
    { message = "^feat", group = "Features" },
    { message = "^fix", group = "Bug Fixes" },
    { message = "^doc", group = "Documentation" },
    { message = "^perf", group = "Performance" },
    { message = "^refactor", group = "Refactor", skip = true },
    { message = "^chore\\(release\\): prepare for", skip = true },
    { message = "^chore", skip = true },
    { message = "^style", group = "Styling", skip = true },
    { message = "^test", skip = true },
    { message = "^ci", skip = true },
]
filter_commits = true
tag_pattern = "[0-9]*"
skip_tags = ""
ignore_tags = ""
date_order = false
sort_commits = "newest"
