# git-cliff ~ configuration file
# https://git-cliff.org/docs/configuration
#
# Conventional Commits → changelog for sunerpy/bedrock-gateway-rust.
# Language-agnostic: release-please manages Cargo.toml version bumps;
# git-cliff is used at release time to render RELEASE_NOTES.md
# (`--latest --strip header`) for the GitHub Release body.

[changelog]
# A Tera template rendered for the changelog body.
header = """
# Changelog\n
All notable changes to this project will be documented in this file.\n
"""
body = """
{% if version %}\
    ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
{% else %}\
    ## [unreleased]
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
    ### {{ group | striptags | trim | upper_first }}
    {% for commit in commits %}
        - {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
            {% if commit.breaking %}[**breaking**] {% endif %}\
            {{ commit.message | upper_first }}\
    {% endfor %}
{% endfor %}\n
"""
footer = """
<!-- generated by git-cliff -->
"""
trim = true
postprocessors = [
  { pattern = '<REPO>', replace = "https://github.com/sunerpy/bedrock-gateway-rust" },
]

[git]
# Parse commits according to the Conventional Commits specification.
conventional_commits = true
filter_unconventional = true
split_commits = false
commit_preprocessors = [
  # Replace issue numbers with links.
  { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/sunerpy/bedrock-gateway-rust/issues/${2}))" },
]
commit_parsers = [
  { message = "^feat", group = "<!-- 0 -->Features" },
  { message = "^fix", group = "<!-- 1 -->Bug Fixes" },
  { message = "^perf", group = "<!-- 2 -->Performance" },
  { message = "^refactor", group = "<!-- 3 -->Refactor" },
  { message = "^doc", group = "<!-- 4 -->Documentation" },
  { message = "^test", group = "<!-- 5 -->Testing" },
  { message = "^ci", group = "<!-- 6 -->CI/CD" },
  { message = "^build", group = "<!-- 7 -->Build" },
  { message = "^chore\\(release\\):", skip = true },
  { message = "^chore\\(deps\\)", skip = true },
  { message = "^chore", group = "<!-- 8 -->Miscellaneous" },
  { message = "^style", group = "<!-- 9 -->Styling" },
  { message = "^revert", group = "<!-- 10 -->Revert" },
  { body = ".*security", group = "<!-- 11 -->Security" },
  { message = ".*", group = "<!-- 12 -->Other" },
]
protect_breaking_commits = false
filter_commits = false
tag_pattern = "v[0-9].*"
skip_tags = ""
ignore_tags = ""
topo_order = false
sort_commits = "oldest"
