|
| 1 | +# git-cliff ~ default configuration file |
| 2 | +# https://git-cliff.org/docs/configuration |
| 3 | +# |
| 4 | +# Lines starting with "#" are comments. |
| 5 | +# Configuration options are organized into tables and keys. |
| 6 | +# See documentation for more information on available options. |
| 7 | + |
| 8 | +[remote.github] |
| 9 | +owner = "seandstewart" |
| 10 | +repo = "python-typelib" |
| 11 | + |
| 12 | +[bump] |
| 13 | +features_always_bump_minor = false |
| 14 | +breaking_always_bump_major = false |
| 15 | + |
| 16 | +[changelog] |
| 17 | +# template for the changelog header |
| 18 | +header = """ |
| 19 | +# Changelog\n |
| 20 | +All notable changes to this project will be documented in this file. |
| 21 | +
|
| 22 | +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), |
| 23 | +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n |
| 24 | +""" |
| 25 | +# template for the changelog body |
| 26 | +# https://keats.github.io/tera/docs/#introduction |
| 27 | +body = """ |
| 28 | +{%- macro remote_url() -%} |
| 29 | + https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} |
| 30 | +{%- endmacro -%} |
| 31 | +{%- macro version_ref() -%} |
| 32 | + [{{ version | trim_start_matches(pat="v") }}][{{ version | trim_start_matches(pat="v") }}] |
| 33 | +{%- endmacro -%} |
| 34 | +
|
| 35 | +
|
| 36 | +{% if version -%} |
| 37 | + ## {{ self::version_ref() }} - {{ timestamp | date(format="%Y-%m-%d") }} |
| 38 | +{% else -%} |
| 39 | + ## [Unreleased][unreleased] |
| 40 | +{% endif -%} |
| 41 | +
|
| 42 | +{% for group, commits in commits | group_by(attribute="group") %} |
| 43 | + ### {{ group | upper_first }} |
| 44 | + {%- for commit in commits %} |
| 45 | + - {{ commit.message | split(pat="\n") | first | upper_first | trim }}\ |
| 46 | + {% if commit.remote.username %} by @{{ commit.remote.username }}{%- endif -%} |
| 47 | + {% if commit.remote.pr_number %} in \ |
| 48 | + [#{{ commit.remote.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.remote.pr_number }}) \ |
| 49 | + {%- endif -%} |
| 50 | + {% endfor %} |
| 51 | +{% endfor %} |
| 52 | +
|
| 53 | +{%- if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %} |
| 54 | + ## New Contributors |
| 55 | +{%- endif -%} |
| 56 | +
|
| 57 | +{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %} |
| 58 | + * @{{ contributor.username }} made their first contribution |
| 59 | + {%- if contributor.pr_number %} in \ |
| 60 | + [#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \ |
| 61 | + {%- endif %} |
| 62 | +{%- endfor %}\n\n |
| 63 | +""" |
| 64 | +# template for the changelog footer |
| 65 | +footer = """ |
| 66 | +{%- macro remote_url() -%} |
| 67 | + https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} |
| 68 | +{%- endmacro -%} |
| 69 | +
|
| 70 | +{% for release in releases -%} |
| 71 | + {% if release.version -%} |
| 72 | + {% if release.previous.version -%} |
| 73 | + [{{ release.version | trim_start_matches(pat="v") }}]: \ |
| 74 | + {{ self::remote_url() }}/compare/{{ release.previous.version }}..{{ release.version }} |
| 75 | + {% endif -%} |
| 76 | + {% else -%} |
| 77 | + [unreleased]: {{ self::remote_url() }}/compare/{{ release.previous.version }}..HEAD |
| 78 | + {% endif -%} |
| 79 | +{% endfor %} |
| 80 | +<!-- generated by git-cliff --> |
| 81 | +""" |
| 82 | +# remove the leading and trailing whitespace from the templates |
| 83 | +trim = true |
| 84 | +output = "docs/changelog.md" |
| 85 | + |
| 86 | +[git] |
| 87 | +# parse the commits based on https://www.conventionalcommits.org |
| 88 | +conventional_commits = true |
| 89 | +# filter out the commits that are not conventional |
| 90 | +filter_unconventional = true |
| 91 | +# process each line of a commit as an individual commit |
| 92 | +split_commits = false |
| 93 | +# regex for preprocessing the commit messages |
| 94 | +commit_preprocessors = [ |
| 95 | + # Replace issue numbers |
| 96 | + { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))"}, |
| 97 | +] |
| 98 | +# regex for parsing and grouping commits |
| 99 | +commit_parsers = [ |
| 100 | + { message = "^feat", group = "<!-- 0 -->🚀 Features" }, |
| 101 | + { message = "^fix", group = "<!-- 1 -->🐛 Bug Fixes" }, |
| 102 | + { message = "^doc", group = "<!-- 3 -->📚 Documentation" }, |
| 103 | + { message = "^perf", group = "<!-- 4 -->⚡ Performance" }, |
| 104 | + { message = "^refactor", group = "<!-- 2 -->🚜 Refactor" }, |
| 105 | + { message = "^style", group = "<!-- 5 -->🎨 Styling" }, |
| 106 | + { message = "^test", group = "<!-- 6 -->🧪 Testing" }, |
| 107 | + { message = "^chore\\(release\\): prepare for", skip = true }, |
| 108 | + { message = "^chore\\(deps.*\\)", skip = true }, |
| 109 | + { message = "^chore\\(pr\\)", skip = true }, |
| 110 | + { message = "^chore\\(pull\\)", skip = true }, |
| 111 | + { message = "^chore|^ci", group = "<!-- 7 -->⚙️ Miscellaneous Tasks" }, |
| 112 | + { body = ".*security", group = "<!-- 8 -->🛡️ Security" }, |
| 113 | + { message = "^revert", group = "<!-- 9 -->◀️ Revert" }, |
| 114 | + { message = ".*", group = "<!-- 10 -->💼 Other" }, |
| 115 | +] |
| 116 | +# filter out the commits that are not matched by commit parsers |
| 117 | +filter_commits = false |
| 118 | +# sort the tags topologically |
| 119 | +topo_order = false |
| 120 | +# sort the commits inside sections by oldest/newest order |
| 121 | +sort_commits = "oldest" |
0 commit comments