|
| 1 | +# git-cliff ~ configuration file |
| 2 | +# https://git-cliff.org/docs/configuration |
| 3 | + |
| 4 | +[changelog] |
| 5 | +# A Tera template to be rendered as the changelog's header. |
| 6 | +# See https://keats.github.io/tera/docs/#introduction |
| 7 | +header = """ |
| 8 | +{% if version -%} |
| 9 | + # Changelog for {{ version }} }} |
| 10 | +{% else -%} |
| 11 | + # Changelog |
| 12 | +{% endif -%} |
| 13 | +
|
| 14 | +All notable changes since last release will be documented below. |
| 15 | +""" |
| 16 | +# A Tera template to be rendered for each release in the changelog. |
| 17 | +# See https://keats.github.io/tera/docs/#introduction |
| 18 | +body = """ |
| 19 | +{%- macro remote_url() -%} |
| 20 | + https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} |
| 21 | +{%- endmacro -%} |
| 22 | +
|
| 23 | +{% for group, commits in commits | group_by(attribute="group") %} |
| 24 | + ### {{ group | upper_first }} |
| 25 | + {%- for commit in commits %} |
| 26 | + - {{ commit.message | split(pat="\n") | first | upper_first | trim }}\ |
| 27 | + {% if commit.remote.username %} by @{{ commit.remote.username }}{%- endif -%} |
| 28 | + {% if commit.remote.pr_number %} in \ |
| 29 | + [#{{ commit.remote.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.remote.pr_number }}) \ |
| 30 | + {%- endif -%} |
| 31 | + {% endfor %} |
| 32 | +{% endfor %} |
| 33 | +""" |
| 34 | +# A Tera template to be rendered as the changelog's footer. |
| 35 | +# See https://keats.github.io/tera/docs/#introduction |
| 36 | +footer = """ |
| 37 | +{%- macro remote_url() -%} |
| 38 | + https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} |
| 39 | +{%- endmacro -%} |
| 40 | +
|
| 41 | +{% for release in releases -%} |
| 42 | + {% if release.version -%} |
| 43 | + {% if release.previous.version -%} |
| 44 | + [{{ release.version | trim_start_matches(pat="v") }}]: \ |
| 45 | + {{ self::remote_url() }}/compare/{{ release.previous.version }}...{{ release.version }} |
| 46 | + {% endif -%} |
| 47 | + {% else -%} |
| 48 | + [unreleased]: {{ self::remote_url() }}/compare/{{ release.previous.version }}...HEAD |
| 49 | + {% endif -%} |
| 50 | +{% endfor %} |
| 51 | +<!-- generated by git-cliff --> |
| 52 | +""" |
| 53 | +# Remove leading and trailing whitespaces from the changelog's body. |
| 54 | +trim = true |
| 55 | + |
| 56 | +[git] |
| 57 | +# Parse commits according to the conventional commits specification. |
| 58 | +# See https://www.conventionalcommits.org |
| 59 | +conventional_commits = true |
| 60 | +# Exclude commits that do not match the conventional commits specification. |
| 61 | +filter_unconventional = false |
| 62 | +# An array of regex based parsers for extracting data from the commit message. |
| 63 | +# Assigns commits to groups. |
| 64 | +# Optionally sets the commit's scope and can decide to exclude commits from further processing. |
| 65 | +commit_parsers = [ |
| 66 | + { message = "^[a|A]dd", group = "Added" }, |
| 67 | + { message = "^[s|S]upport", group = "Added" }, |
| 68 | + { message = "^[r|R]emove", group = "Removed" }, |
| 69 | + { message = "^.*: add", group = "Added" }, |
| 70 | + { message = "^.*: support", group = "Added" }, |
| 71 | + { message = "^.*: remove", group = "Removed" }, |
| 72 | + { message = "^.*: delete", group = "Removed" }, |
| 73 | + { message = "^test", group = "Fixed" }, |
| 74 | + { message = "^fix", group = "Fixed" }, |
| 75 | + { message = "^.*: fix", group = "Fixed" }, |
| 76 | + { message = "^.*", group = "Changed" }, |
| 77 | +] |
| 78 | +# Prevent commits that are breaking from being excluded by commit parsers. |
| 79 | +filter_commits = false |
| 80 | +# Order releases topologically instead of chronologically. |
| 81 | +topo_order = true |
| 82 | +# Order of commits in each group/release within the changelog. |
| 83 | +# Allowed values: newest, oldest |
| 84 | +sort_commits = "oldest" |
0 commit comments