|
| 1 | +# git-cliff ~ 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 | +[changelog] |
| 9 | +# changelog header |
| 10 | +header = """ |
| 11 | + |
| 12 | +""" |
| 13 | +# template for the changelog body |
| 14 | +# https://keats.github.io/tera/docs/#introduction |
| 15 | +body = """ |
| 16 | +{%- macro remote_url() -%} |
| 17 | + https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} |
| 18 | +{%- endmacro -%} |
| 19 | +
|
| 20 | +{% macro print_commit(commit) -%} |
| 21 | + - {% if commit.scope %}*({{ commit.scope }})* {% endif %}\ |
| 22 | + {% if commit.breaking %}[**breaking**] {% endif %}\ |
| 23 | + {{ commit.message | upper_first }} - \ |
| 24 | + ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ |
| 25 | +{% endmacro -%} |
| 26 | +
|
| 27 | +{% if version %}\ |
| 28 | + {% if previous.version %}\ |
| 29 | + ## [{{ version | trim_start_matches(pat="v") }}]\ |
| 30 | + ({{ self::remote_url() }}/compare/{{ previous.version }}..{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }} |
| 31 | + {% else %}\ |
| 32 | + ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} |
| 33 | + {% endif %}\ |
| 34 | +{% else %}\ |
| 35 | + ## [unreleased] |
| 36 | +{% endif %}\ |
| 37 | +
|
| 38 | +{% for group, commits in commits | group_by(attribute="group") %} |
| 39 | + ### {{ group | striptags | trim | upper_first }} |
| 40 | + {% for commit in commits |
| 41 | + | filter(attribute="scope") |
| 42 | + | sort(attribute="scope") %} |
| 43 | + {{ self::print_commit(commit=commit) }} |
| 44 | + {%- endfor -%} |
| 45 | + {% raw %}\n{% endraw %}\ |
| 46 | + {%- for commit in commits %} |
| 47 | + {%- if not commit.scope -%} |
| 48 | + {{ self::print_commit(commit=commit) }} |
| 49 | + {% endif -%} |
| 50 | + {% endfor -%} |
| 51 | +{% endfor %}\n |
| 52 | +""" |
| 53 | +# template for the changelog footer |
| 54 | +footer = """ |
| 55 | +""" |
| 56 | +# remove the leading and trailing whitespace from the templates |
| 57 | +trim = true |
| 58 | +# postprocessors |
| 59 | +postprocessors = [ |
| 60 | + { pattern = '<REPO>', replace = "https://github.com/topos-protocol/topos" }, # replace repository URL |
| 61 | +] |
| 62 | + |
| 63 | +[git] |
| 64 | +# parse the commits based on https://www.conventionalcommits.org |
| 65 | +conventional_commits = true |
| 66 | +# filter out the commits that are not conventional |
| 67 | +filter_unconventional = true |
| 68 | +# process each line of a commit as an individual commit |
| 69 | +split_commits = false |
| 70 | +# regex for preprocessing the commit messages |
| 71 | +commit_preprocessors = [ |
| 72 | + { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))" }, |
| 73 | + # Check spelling of the commit with https://github.com/crate-ci/typos |
| 74 | + # If the spelling is incorrect, it will be automatically fixed. |
| 75 | + { pattern = '.*', replace_command = 'typos --write-changes -' }, |
| 76 | +] |
| 77 | +# regex for parsing and grouping commits |
| 78 | +commit_parsers = [ |
| 79 | + { message = "^feat", group = "<!-- 0 -->⛰️ Features" }, |
| 80 | + { message = "^fix", group = "<!-- 1 -->🐛 Bug Fixes" }, |
| 81 | + { message = "^doc", group = "<!-- 3 -->📚 Documentation" }, |
| 82 | + { message = "^perf", group = "<!-- 4 -->⚡ Performance" }, |
| 83 | + { message = "^refactor\\(clippy\\)", skip = true }, |
| 84 | + { message = "^refactor", group = "<!-- 2 -->🚜 Refactor" }, |
| 85 | + { message = "^style", group = "<!-- 5 -->🎨 Styling" }, |
| 86 | + { message = "^test", group = "<!-- 6 -->🧪 Testing" }, |
| 87 | + { message = "^chore\\(release\\): prepare for", skip = true }, |
| 88 | + { message = "^chore\\(deps.*\\)", skip = true }, |
| 89 | + { message = "^chore\\(pr\\)", skip = true }, |
| 90 | + { message = "^chore\\(pull\\)", skip = true }, |
| 91 | + { message = "^chore|^ci", group = "<!-- 7 -->⚙️ Miscellaneous Tasks" }, |
| 92 | + { body = ".*security", group = "<!-- 8 -->🛡️ Security" }, |
| 93 | + { message = "^revert", group = "<!-- 9 -->◀️ Revert" }, |
| 94 | +] |
| 95 | +# protect breaking changes from being skipped due to matching a skipping commit_parser |
| 96 | +protect_breaking_commits = false |
| 97 | +# filter out the commits that are not matched by commit parsers |
| 98 | +filter_commits = false |
| 99 | +# regex for matching git tags |
| 100 | +tag_pattern = "v[0-9].*" |
| 101 | +# regex for skipping tags |
| 102 | +skip_tags = "beta|alpha" |
| 103 | +# regex for ignoring tags |
| 104 | +ignore_tags = "rc|v2.1.0|v2.1.1" |
| 105 | +# sort the tags topologically |
| 106 | +topo_order = false |
| 107 | +# sort the commits inside sections by oldest/newest order |
| 108 | +sort_commits = "newest" |
0 commit comments