[git]
conventional_commits = true
filter_unconventional = true
split_commits = false
filter_commits = false
protect_breaking_commits = true
sort_commits = "newest"
tag_pattern = "v[0-9].*"
ignore_tags = "rc|beta|alpha"
skip_tags = ""
topo_order = false
commit_preprocessors = [
{ pattern = '\((\w+\s)?[!#]([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))" },
{ pattern = " +", replace = " " },
]
commit_parsers = [
{ message = "^(ci|build|chore)\\(deps.*\\)", skip = true },
{ message = "^chore\\(release\\)", skip = true },
{ message = "^fix\\(deps.*\\): update dependency ([^\\s]+)", scope = "${1}", group = "<!-- 8 -->Dependencies" },
{ message = "^fix\\(deps.*\\)", group = "<!-- 8 -->Dependencies" },
{ message = "^feat", group = "<!-- 0 -->Features" },
{ message = "^fix", group = "<!-- 1 -->Bug fixes" },
{ message = "^refactor", group = "<!-- 2 -->Refactor" },
{ message = "^doc", group = "<!-- 3 -->Documentation" },
{ message = "^perf", group = "<!-- 32 -->Performance" },
{ message = "^build", group = "<!-- 4 -->Build" },
{ body = ".*security", group = "<!-- 5 -->Security" },
{ message = "^test", group = "<!-- 6 -->Testing" },
{ message = "^style", group = "<!-- 62 -->Styling" },
{ message = "^(ci|chore)", group = "<!-- 7 -->Chores" },
{ message = "^revert", group = "<!-- 9 -->Revert" },
]
[changelog]
postprocessors = [{ pattern = '<REPO>', replace = "https://github.com/deadnews/imgup" }]
header = """
# Changelog\n
"""
body = """
{%- macro print_commit(commit) -%}
- {% if commit.scope %}_({{ commit.scope }})_ {% endif %}{% if commit.breaking %}[**breaking**] {% endif %}\
{{ commit.message }} - ([{{ commit.id | truncate(length=7, end="") }}](<REPO>/commit/{{ commit.id }}))
{%- endmacro -%}
{%- macro print_deps_commit(commit) -%}
- {{ commit.message }} - ([{{ commit.id | truncate(length=7, end="") }}](<REPO>/commit/{{ commit.id }}))
{%- endmacro -%}
{%- if version -%}
{%- if previous.version -%}
## [{{ version | trim_start_matches(pat="v") }}]\
(<REPO>/compare/{{ previous.version }}...{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }}
{%- else -%}
## [{{ version | trim_start_matches(pat="v") }}]\
(<REPO>/commits/{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }}
{%- endif -%}
{%- else -%}
## [unreleased]
{%- endif %}
{%- for group, commits in commits | group_by(attribute="group") %}
### {{ group | striptags | trim | upper_first }}
{% if group | striptags | trim | lower == "dependencies" -%}
{%- for scope, scoped_commits in commits | filter(attribute="scope") | group_by(attribute="scope") %}
{{ self::print_deps_commit(commit=scoped_commits | first) }}
{%- endfor -%}
{%- for commit in commits -%}
{%- if not commit.scope %}
{{ self::print_deps_commit(commit=commit) }}
{%- endif -%}
{%- endfor -%}
{%- else -%}
{%- for commit in commits | filter(attribute="scope") | sort(attribute="scope") %}
{{ self::print_commit(commit=commit) }}
{%- endfor -%}
{%- for commit in commits -%}
{%- if not commit.scope %}
{{ self::print_commit(commit=commit) }}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{%- endfor -%}
{% raw %}\n
{% endraw %}
"""
footer = """
<!-- generated by git-cliff -->
"""
trim = true