|
| 1 | +# Configuration file for git-cliff |
| 2 | + |
| 3 | +[changelog] |
| 4 | +trim = false |
| 5 | + |
| 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 | + |
| 16 | +# https://tera.netlify.app/docs/#introduction |
| 17 | +body = """ |
| 18 | +{% if version -%} |
| 19 | + ## [[{{ version | trim_start_matches(pat="v") }}]{%- if release_link -%}({{ release_link }}){% endif %}] - {{ timestamp | date(format="%Y-%m-%d") }} |
| 20 | +{%- else -%} |
| 21 | + ## [Unreleased] |
| 22 | +{%- endif %} |
| 23 | +
|
| 24 | +{% for group, commits in commits | group_by(attribute="group") -%} |
| 25 | +
|
| 26 | +### {{ group | upper_first }} |
| 27 | +
|
| 28 | +{%- for commit in commits %} |
| 29 | +
|
| 30 | +{%- set message = commit.message | upper_first %} |
| 31 | +
|
| 32 | +{%- if commit.breaking %} |
| 33 | + {%- set breaking = "[**breaking**] " %} |
| 34 | +{%- else %} |
| 35 | + {%- set breaking = "" %} |
| 36 | +{%- endif %} |
| 37 | +
|
| 38 | +{%- set short_sha = commit.id | truncate(length=10, end="") %} |
| 39 | +{%- set commit_url = "https://github.com/Devolutions/picky-rs/commit/" ~ commit.id %} |
| 40 | +{%- set commit_link = "[" ~ short_sha ~ "](" ~ commit_url ~ ")" %} |
| 41 | +
|
| 42 | +- {{ breaking }}{{ message }} ({{ commit_link }}) \ |
| 43 | + {% if commit.body %}\n\n {{ commit.body | replace(from="\n", to="\n ") }}{% endif %} |
| 44 | +{%- endfor %} |
| 45 | +
|
| 46 | +{% endfor -%} |
| 47 | +""" |
| 48 | + |
| 49 | +footer = "" |
| 50 | + |
| 51 | +[git] |
| 52 | +conventional_commits = true |
| 53 | +filter_unconventional = false |
| 54 | +filter_commits = false |
| 55 | +date_order = false |
| 56 | +protect_breaking_commits = true |
| 57 | +sort_commits = "oldest" |
| 58 | + |
| 59 | +commit_preprocessors = [ |
| 60 | + # Replace issue number with the link |
| 61 | + { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/Devolutions/picky-rs/issues/${2}))"}, |
| 62 | + # Replace commit sha1 with the link |
| 63 | + { pattern = '([a-f0-9]{10})([a-f0-9]{30})', replace = "[${0}](https://github.com/Devolutions/picky-rs/commit/${1}${2})" } |
| 64 | +] |
| 65 | + |
| 66 | +# regex for parsing and grouping commits |
| 67 | +# <!-- <NUMBER> --> is a trick to control the section order: https://github.com/orhun/git-cliff/issues/9#issuecomment-914521594 |
| 68 | +commit_parsers = [ |
| 69 | + { message = "^chore", skip = true }, |
| 70 | + { message = "^style", skip = true }, |
| 71 | + { message = "^refactor", skip = true }, |
| 72 | + { message = "^test", skip = true }, |
| 73 | + { message = "^ci", skip = true }, |
| 74 | + { message = "^chore\\(release\\): prepare for", skip = true }, |
| 75 | + { footer = "^[Cc]hangelog: ?ignore", skip = true }, |
| 76 | + |
| 77 | + { message = "(?i)security", group = "<!-- 0 -->Security" }, |
| 78 | + { body = "(?i)security", group = "<!-- 0 -->Security" }, |
| 79 | + { footer = "^[Ss]ecurity: ?yes", group = "<!-- 0 -->Security" }, |
| 80 | + |
| 81 | + { message = "^feat", group = "<!-- 1 -->Features" }, |
| 82 | + |
| 83 | + { message = "^revert", group = "<!-- 3 -->Revert" }, |
| 84 | + { message = "^fix", group = "<!-- 4 -->Bug Fixes" }, |
| 85 | + { message = "^perf", group = "<!-- 5 -->Performance" }, |
| 86 | + { message = "^doc", group = "<!-- 6 -->Documentation" }, |
| 87 | + { message = "^build", group = "<!-- 7 -->Build" }, |
| 88 | + |
| 89 | + { message = "(?i)improve", group = "<!-- 2 -->Improvements" }, |
| 90 | + { message = "(?i)adjust", group = "<!-- 2 -->Improvements" }, |
| 91 | + { message = "(?i)change", group = "<!-- 2 -->Improvements" }, |
| 92 | + |
| 93 | + { message = ".*", group = "<!-- 99 -->Please Sort" }, |
| 94 | +] |
0 commit comments