From bafef06e908b6c4e053482424ff5692667cb9f1a Mon Sep 17 00:00:00 2001 From: kolaente Date: Wed, 3 Aug 2022 20:10:39 +0200 Subject: [PATCH] chore: add git-cliff config --- cliff.toml | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 cliff.toml diff --git a/cliff.toml b/cliff.toml new file mode 100644 index 00000000..02cfdb85 --- /dev/null +++ b/cliff.toml @@ -0,0 +1,59 @@ +[changelog] +body = """ +{% if version %}\ + ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} +{% else %}\ + ## [unreleased] +{% endif %}\ + + +{% for group, commits in commits | group_by(attribute="group") %} + ### {{ group | upper_first }} + {% for commit in commits + | filter(attribute="scope") + | sort(attribute="scope") %} + * *({{commit.scope}})* {{ commit.message | upper_first }} + {%- if commit.breaking %} + {% raw %} {% endraw %}- **BREAKING**: {{commit.breaking_description}} + {%- endif -%} + {%- endfor -%} + {%- for commit in commits %} + {%- if commit.scope -%} + {% else -%} + * {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ commit.id }})) + {% if commit.breaking -%} + {% raw %} {% endraw %}- **BREAKING**: {{commit.breaking_description}} + {% endif -%} + {% endif -%} + {% endfor -%} + {% raw %}\n{% endraw %}\ +{% endfor %}\n + +""" +#{% for group, commits in commits | group_by(attribute="group") %} +# ### {{ group | upper_first }} +# {% for commit in commits %}\ +# - {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ commit.id }})) +# {% endfor %}\ +#{% endfor %}\n +# remove the leading and trailing whitespace from the template +trim = true + +[git] +conventional_commits = true +filter_unconventional = false +commit_parsers = [ + { message = ".*(deps).*", group = "Dependencies"}, + { message = "^feat", group = "Features"}, + { message = "^fix", group = "Bug Fixes"}, + { message = "^doc", group = "Documentation"}, + { message = "^perf", group = "Performance"}, + { message = "^refactor", group = "Refactor"}, + { message = "^style", group = "Styling"}, + { message = "^test", group = "Testing"}, + { message = "^chore\\(release\\): prepare for", skip = true}, + { message = "^chore", group = "Miscellaneous Tasks"}, + { body = ".*security", group = "Security"}, + { message = ".*", group = "Other", default_scope = "other"}, # Everything that's not a conventional commit goes into the "Other" category +] +