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