|
| 1 | +# git-cliff configuration for changelog generation |
| 2 | +# See: https://git-cliff.org/docs/configuration |
| 3 | + |
| 4 | +[changelog] |
| 5 | +# changelog header |
| 6 | +header = """ |
| 7 | +# Changelog |
| 8 | +
|
| 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). |
| 13 | +
|
| 14 | +""" |
| 15 | +# template for the changelog body |
| 16 | +body = """ |
| 17 | +{%- if version %} |
| 18 | +## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} |
| 19 | +{%- set release_type = "" %} |
| 20 | +{%- if version is matching("v?[0-9]+\\.0\\.0") %} |
| 21 | +{%- set release_type = "major" %} |
| 22 | +{%- elif version is matching("v?[0-9]+\\.[0-9]+\\.0") %} |
| 23 | +{%- set release_type = "minor" %} |
| 24 | +{%- else %} |
| 25 | +{%- set release_type = "patch" %} |
| 26 | +{%- endif %} |
| 27 | +
|
| 28 | +This **{{ release_type }} release** includes {{ commits | length }} commit{%- if commits | length != 1 %}s{%- endif %}. |
| 29 | +{% else %} |
| 30 | +## [Unreleased] |
| 31 | +{%- endif %} |
| 32 | +{%- for group, commits in commits | group_by(attribute="group") %} |
| 33 | +
|
| 34 | +### {{ group | striptags | trim | upper_first }} |
| 35 | +{%- for commit in commits %} |
| 36 | +- {{ commit.message | upper_first }}{%- if commit.remote.pr_number %} ([#{{ commit.remote.pr_number }}](https://github.com/stateful-y/yohou/pull/{{ commit.remote.pr_number }})){%- endif %}{%- if commit.remote.username %} by @{{ commit.remote.username }}{%- endif %} |
| 37 | +{%- endfor %} |
| 38 | +{%- endfor %} |
| 39 | +{%- set new_contributors = commits | filter(attribute="remote.username") | map(attribute="remote.username") | unique %} |
| 40 | +{%- if new_contributors | length > 0 %} |
| 41 | +
|
| 42 | +### Contributors |
| 43 | +
|
| 44 | +Thanks to all contributors for this release: |
| 45 | +{%- for contributor in new_contributors %} |
| 46 | +- @{{ contributor }} |
| 47 | +{%- endfor %} |
| 48 | +{%- endif %} |
| 49 | +
|
| 50 | +""" |
| 51 | +# template for the changelog footer |
| 52 | +footer = """ |
| 53 | +<!-- generated by git-cliff --> |
| 54 | +""" |
| 55 | +# remove the leading and trailing whitespace from the templates |
| 56 | +trim = true |
| 57 | +# postprocessors to apply to the generated changelog |
| 58 | +postprocessors = [] |
| 59 | + |
| 60 | +[git] |
| 61 | +# parse the commits based on https://www.conventionalcommits.org |
| 62 | +conventional_commits = true |
| 63 | +# filter out the commits that are not conventional |
| 64 | +filter_unconventional = true |
| 65 | +# process each line of a commit as an individual commit |
| 66 | +split_commits = false |
| 67 | +# regex for preprocessing the commit messages |
| 68 | +commit_preprocessors = [ |
| 69 | + # Remove issue numbers from commits |
| 70 | + { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" }, |
| 71 | +] |
| 72 | +# regex for parsing and grouping commits |
| 73 | +commit_parsers = [ |
| 74 | + { message = "^feat", group = "<!-- 0 -->Features" }, |
| 75 | + { message = "^fix", group = "<!-- 1 -->Bug Fixes" }, |
| 76 | + { message = "^doc", group = "<!-- 2 -->Documentation" }, |
| 77 | + { message = "^perf", group = "<!-- 3 -->Performance" }, |
| 78 | + { message = "^refactor", group = "<!-- 4 -->Refactoring" }, |
| 79 | + { message = "^style", group = "<!-- 5 -->Styling" }, |
| 80 | + { message = "^test", group = "<!-- 6 -->Testing" }, |
| 81 | + { message = "^chore\\(release\\)", skip = true }, |
| 82 | + { message = "^chore\\(deps.*\\)", skip = true }, |
| 83 | + { message = "^chore\\(pr\\)", skip = true }, |
| 84 | + { message = "^chore\\(pull\\)", skip = true }, |
| 85 | + { message = "^chore|^ci", group = "<!-- 7 -->Miscellaneous Tasks" }, |
| 86 | + { body = ".*security", group = "<!-- 8 -->Security" }, |
| 87 | + { message = "^revert", group = "<!-- 9 -->Revert" }, |
| 88 | +] |
| 89 | +# protect breaking changes from being skipped due to matching a skipping commit_parser |
| 90 | +protect_breaking_commits = false |
| 91 | +# filter out the commits that are not matched by commit parsers |
| 92 | +filter_commits = false |
| 93 | +# sort the tags topologically |
| 94 | +topo_order = false |
| 95 | +# sort the commits inside sections by oldest/newest order |
| 96 | +sort_commits = "oldest" |
| 97 | +# limit the number of commits included in the changelog. |
| 98 | +# limit_commits = 42 |
| 99 | + |
| 100 | +[remote.github] |
| 101 | +owner = "stateful-y" |
| 102 | +repo = "yohou" |
0 commit comments