Skip to content

Commit

Permalink
Merge pull request #68 from epics-extensions/git-cliff
Browse files Browse the repository at this point in the history
feat: add CHANGELOG generation support with git-cliff
  • Loading branch information
minijackson authored Dec 13, 2023
2 parents d93b2ea + 39a964e commit e0f0882
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = """
<!-- generated by git-cliff -->
"""
postprocessors = [
{ pattern = '<REPO>', 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}](<REPO>/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"

0 comments on commit e0f0882

Please sign in to comment.