|
| 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 | +# Changelog\n |
| 9 | +All notable changes to this project will be documented in this file. |
| 10 | +
|
| 11 | +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), |
| 12 | +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n |
| 13 | +""" |
| 14 | +# A Tera template to be rendered for each release in the changelog. |
| 15 | +# See https://keats.github.io/tera/docs/#introduction |
| 16 | +body = """ |
| 17 | +{%- macro remote_url() -%} |
| 18 | + https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} |
| 19 | +{%- endmacro -%} |
| 20 | +
|
| 21 | +{% if version -%} |
| 22 | + ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} |
| 23 | +{% else -%} |
| 24 | + ## [Unreleased] |
| 25 | +{% endif -%} |
| 26 | +
|
| 27 | +{% for group, commits in commits | group_by(attribute="group") %} |
| 28 | + ### {{ group | upper_first }} |
| 29 | + {%- for commit in commits %} |
| 30 | + - {{ commit.message | split(pat="\n") | first | upper_first | trim }}\ |
| 31 | + {% if commit.remote.username %} by @{{ commit.remote.username }}{%- endif -%} |
| 32 | + {% if commit.remote.pr_number %} in \ |
| 33 | + [#{{ commit.remote.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.remote.pr_number }}) \ |
| 34 | + {%- endif -%} |
| 35 | + {% endfor %} |
| 36 | +{% endfor %} |
| 37 | +
|
| 38 | +{%- if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %} |
| 39 | + ## New Contributors |
| 40 | +{%- endif -%} |
| 41 | +
|
| 42 | +{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %} |
| 43 | + * @{{ contributor.username }} made their first contribution |
| 44 | + {%- if contributor.pr_number %} in \ |
| 45 | + [#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \ |
| 46 | + {%- endif %} |
| 47 | +{%- endfor %}\n |
| 48 | +""" |
| 49 | +# A Tera template to be rendered as the changelog's footer. |
| 50 | +# See https://keats.github.io/tera/docs/#introduction |
| 51 | +footer = """ |
| 52 | +{%- macro remote_url() -%} |
| 53 | + https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} |
| 54 | +{%- endmacro -%} |
| 55 | +
|
| 56 | +{% for release in releases -%} |
| 57 | + {% if release.version -%} |
| 58 | + {% if release.previous.version -%} |
| 59 | + [{{ release.version | trim_start_matches(pat="v") }}]: \ |
| 60 | + {{ self::remote_url() }}/compare/{{ release.previous.version }}..{{ release.version }} |
| 61 | + {% endif -%} |
| 62 | + {% else -%} |
| 63 | + {% if release.previous.version -%} |
| 64 | + [unreleased]: {{ self::remote_url() }}/compare/{{ release.previous.version }}..HEAD |
| 65 | + {% endif -%} |
| 66 | + {% endif -%} |
| 67 | +{% endfor %} |
| 68 | +<!-- generated by git-cliff --> |
| 69 | +""" |
| 70 | +# Remove leading and trailing whitespaces from the changelog's body. |
| 71 | +trim = true |
| 72 | + |
| 73 | +[git] |
| 74 | +# regex for matching git tags |
| 75 | +tag_pattern = "api-v[0-9].*" |
| 76 | +# Parse commits according to the conventional commits specification. |
| 77 | +# See https://www.conventionalcommits.org |
| 78 | +conventional_commits = true |
| 79 | +# Exclude commits that do not match the conventional commits specification. |
| 80 | +filter_unconventional = false |
| 81 | +# An array of regex based parsers to modify commit messages prior to further processing. |
| 82 | +commit_preprocessors = [ |
| 83 | + # Remove issue numbers. |
| 84 | + { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" }, |
| 85 | +] |
| 86 | +# An array of regex based parsers for extracting data from the commit message. |
| 87 | +# Assigns commits to groups. |
| 88 | +# Optionally sets the commit's scope and can decide to exclude commits from further processing. |
| 89 | +commit_parsers = [ |
| 90 | + { message = "^[a|A]dd", group = "Added" }, |
| 91 | + { message = "^[s|S]upport", group = "Added" }, |
| 92 | + { message = "^[r|R]emove", group = "Removed" }, |
| 93 | + { message = "^.*: add", group = "Added" }, |
| 94 | + { message = "^.*: support", group = "Added" }, |
| 95 | + { message = "^.*: remove", group = "Removed" }, |
| 96 | + { message = "^.*: delete", group = "Removed" }, |
| 97 | + { message = "^test", group = "Fixed" }, |
| 98 | + { message = "^fix", group = "Fixed" }, |
| 99 | + { message = "^.*: fix", group = "Fixed" }, |
| 100 | + { message = "^.*", group = "Changed" }, |
| 101 | +] |
| 102 | +# Exclude commits that are not matched by any commit parser. |
| 103 | +filter_commits = false |
| 104 | +# Order releases topologically instead of chronologically. |
| 105 | +topo_order = false |
| 106 | +# Order of commits in each group/release within the changelog. |
| 107 | +# Allowed values: newest, oldest |
| 108 | +sort_commits = "newest" |
0 commit comments