# git-cliff configuration for generating CHANGELOG.md.
# See https://git-cliff.org/docs/configuration

[changelog]
header = """
# Changelog

All notable changes to this project are documented here.

The project follows Semantic Versioning while the public DSL is still young:
patch releases should not intentionally break existing templates, and minor
releases may add syntax or tighten diagnostics.

"""
body = """
{% if version %}## {{ version | trim_start_matches(pat="v") }}{% else %}## Unreleased{% endif %}

{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | striptags | trim }}

{% for commit in commits %}
- {{ commit.message | upper_first }}
{% endfor %}

{% endfor %}
"""
trim = true
footer = ""
postprocessors = []

[git]
conventional_commits = true
filter_unconventional = false
split_commits = false
tag_pattern = "v[0-9]*"
skip_tags = ""
ignore_tags = ""
topo_order = false
sort_commits = "oldest"

commit_preprocessors = [
  { pattern = "\\((\\w+\\s)?#([0-9]+)\\)", replace = "([#${2}](https://github.com/ensiouel/mup/issues/${2}))" },
]

commit_parsers = [
  { message = "^feat", group = "Added" },
  { message = "^fix", group = "Fixed" },
  { message = "^doc", group = "Documentation" },
  { message = "^perf", group = "Performance" },
  { message = "^refactor", group = "Changed" },
  { message = "^style", group = "Changed" },
  { message = "^test", group = "Testing" },
  { message = "^ci", group = "CI" },
  { message = "^build", group = "Build" },
  { message = "^chore\\(release\\)", skip = true },
  { message = "^chore", group = "Maintenance" },
  { message = ".*", group = "Other" },
]

protect_breaking_commits = true
filter_commits = false
