|
| 1 | +[changelog] |
| 2 | +header = """# Changelog |
| 3 | +
|
| 4 | +## [Unreleased] |
| 5 | +""" |
| 6 | + |
| 7 | +body = """ |
| 8 | +
|
| 9 | +{% macro print_commit(commit) -%} |
| 10 | + - {% if commit.scope %}*({{ commit.scope }})* {% endif %}\ |
| 11 | + {% if commit.breaking %}[**breaking**] {% endif %}\ |
| 12 | + {{ commit.message | upper_first }} - \ |
| 13 | + ([{{ commit.id | truncate(length=7, end="") }}]({{ remote.link }}/commit/{{ commit.id }}))\ |
| 14 | +{% endmacro -%} |
| 15 | +
|
| 16 | +{% if version %}\ |
| 17 | + {% if previous.version %}\ |
| 18 | + ## [{{ version | trim_start_matches(pat="v") }}]({{ release_link }}) |
| 19 | + {% else %}\ |
| 20 | + ## [{{ version | trim_start_matches(pat="v") }}] |
| 21 | + {% endif %}\ |
| 22 | +{% endif %}\ |
| 23 | +
|
| 24 | +{% for group, commits in commits |
| 25 | +| filter(attribute="merge_commit", value=false) |
| 26 | +| unique(attribute="message") |
| 27 | +| group_by(attribute="group") %} |
| 28 | + ### {{ group | striptags | trim | upper_first }} |
| 29 | + {% for commit in commits |
| 30 | + | filter(attribute="scope") |
| 31 | + | sort(attribute="scope") %} |
| 32 | + {{ self::print_commit(commit=commit) }} |
| 33 | + {%- endfor -%} |
| 34 | + {% raw %}\n{% endraw %}\ |
| 35 | + {%- for commit in commits %} |
| 36 | + {%- if not commit.scope -%} |
| 37 | + {{ self::print_commit(commit=commit) }} |
| 38 | + {% endif -%} |
| 39 | + {% endfor -%} |
| 40 | +{% endfor %}\n |
| 41 | +""" |
| 42 | + |
| 43 | +commit_parsers = [ |
| 44 | + { message = "^feat", group = "<!-- 0 -->⛰️ Features" }, |
| 45 | + { message = "^fix", group = "<!-- 1 -->🐛 Bug Fixes" }, |
| 46 | + { message = "^doc", group = "<!-- 3 -->📚 Documentation" }, |
| 47 | + { message = "^perf", group = "<!-- 4 -->⚡ Performance" }, |
| 48 | + { message = "^refactor\\(clippy\\)", skip = true }, |
| 49 | + { message = "^refactor", group = "<!-- 2 -->🚜 Refactor" }, |
| 50 | + { message = "^style", group = "<!-- 5 -->🎨 Styling" }, |
| 51 | + { message = "^test", group = "<!-- 6 -->🧪 Testing" }, |
| 52 | + { message = "^chore\\(release\\):", skip = true }, |
| 53 | + { message = "^chore: release", skip = true }, |
| 54 | + { message = "^chore\\(deps.*\\)", skip = true }, |
| 55 | + { message = "^chore\\(pr\\)", skip = true }, |
| 56 | + { message = "^chore\\(pull\\)", skip = true }, |
| 57 | + { message = "^chore\\(npm\\).*yarn\\.lock", skip = true }, |
| 58 | + { message = "^chore|^ci", group = "<!-- 7 -->⚙️ Miscellaneous Tasks" }, |
| 59 | + { body = ".*security", group = "<!-- 8 -->🛡️ Security" }, |
| 60 | + { message = "^revert", group = "<!-- 9 -->◀️ Revert" }, |
| 61 | +] |
| 62 | + |
| 63 | +link_parsers = [ |
| 64 | + { pattern = "#(\\d+)", href = "{{ remote.link }}/issues/$1" }, |
| 65 | + { pattern = "RFC(\\d+)", text = "ietf-rfc$1", href = "https://datatracker.ietf.org/doc/html/rfc$1" }, |
| 66 | +] |
0 commit comments