diff --git a/pyproject.toml b/pyproject.toml index 9056894..fafdf7d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,3 +65,59 @@ ignore = [ # single-line-implicit-string-concatenation "ISC001", ] + +# https://git-cliff.org/docs/configuration +[tool.git-cliff.changelog] +header = """ +# Changelog\n +All notable changes to this project are documented in this file.\n +""" +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 %} + - {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}\ + {% endfor %} +{% endfor %}\n +""" +trim = true +footer = """ + +""" +postprocessors = [ + { pattern = '', replace = "https://github.com/epics-extensions/WeTest" }, +] + +[tool.git-cliff.git] +conventional_commits = true +filter_unconventional = true +commit_preprocessors = [ + # replace issue numbers + { pattern = "\\(#([0-9]+)\\)", replace = "([#${1}](/issues/${1}))" }, +] +commit_parsers = [ + { 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\\(deps\\)", skip = true }, + { message = "^chore\\(pr\\)", skip = true }, + { message = "^chore\\(pull\\)", skip = true }, + { message = "^chore|ci", group = "Miscellaneous Tasks" }, + { body = ".*security", group = "Security" }, + { message = "^revert", group = "Revert" }, +] +protect_breaking_commits = true +# filter out the commits that are not matched by commit parsers +filter_commits = false +tag_pattern = "v[0-9].*" +sort_commits = "oldest"