Skip to content

Commit

Permalink
misc: improve changelog generation configuration
Browse files Browse the repository at this point in the history
Heavily inspired by git-cliff's own cliff.toml.
  • Loading branch information
jan-ferdinand committed Nov 29, 2023
1 parent 2e9ebd7 commit 9e3432f
Showing 1 changed file with 26 additions and 9 deletions.
35 changes: 26 additions & 9 deletions cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,47 +5,64 @@

header = ""
body = """
release Triton VM {{ version }}
{% if version %}\
{% if previous.version %}\
## [{{ version | trim_start_matches(pat="v") }}](<REPO>/compare/{{ previous.version }}..{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }}
{% else %}\
## {{ version | trim_start_matches(pat="v") }} - {{ timestamp | date(format="%Y-%m-%d") }}
{% endif %}\
{% else %}\
## [unreleased]
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
# {{ group | striptags | trim | upper_first }}
### {{ group | striptags | trim | upper_first }}
{% for commit in commits %}
- {% if commit.breaking %}(!) {% endif %}{{ commit.message | upper_first }} ({{ commit.id | truncate(length=8, end="") }})\
- {% if commit.breaking %}(!) {% endif %}\
{% if commit.scope %}*({{ commit.scope }})* {% endif %}\
{{ commit.message | upper_first }} \
([{{ commit.id | truncate(length=8, end="") }}](<REPO>/commit/{{ commit.id | truncate(length=8, end="") }}))\
{% endfor %}
{% endfor %}\n
"""
footer = "Note: (!) indicates a breaking change.\n"
trim = true

postprocessors = []
postprocessors = [
{ pattern = '<REPO>', replace = "https://github.com/TritonVM/triton-vm" },
]

[git]

conventional_commits = true
filter_unconventional = true
split_commits = false
commit_preprocessors = []
commit_preprocessors = [
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))" },
]

# Use <!-- prio --> hack to sort the categories. See: https://github.com/orhun/git-cliff/issues/9
commit_parsers = [
{ message = "^feat", group = "<!-- 00 --> ✨ Features" },
{ message = "^fix", group = "<!-- 10 --> 🐛 Bug Fixes" },
{ message = "^perf", group = "<!-- 20 --> ⚡️ Performance" },
{ message = "^doc", group = "<!-- 30 --> 📝 Documentation" },
{ message = "^doc", group = "<!-- 30 --> 📚 Documentation" },
{ message = "^WIP", skip = true },
{ message = "^chore\\(deps\\)", skip = true },
{ message = "^chore\\(pr\\)", skip = true },
{ message = "^chore\\(pull\\)", skip = true },
{ message = "^chore|ci|misc", group = "<!-- 40 --> 🔧 Miscellaneous" },
{ message = "^chore|ci|misc", group = "<!-- 40 --> ⚙️ Miscellaneous" },
{ message = "^refactor", group = "<!-- 50 --> ♻️ Refactor" },
{ message = "^test", group = "<!-- 60 --> ✅ Testing" },
{ body = ".*security", group = "<!-- 70 --> 🔒️ Security" },
{ message = "^revert", group = "<!-- 80 --> ⏪️ Revert" },
{ message = "^style", group = "<!-- 90 --> 💄 Styling" },
{ message = "^style", group = "<!-- 90 --> 🎨 Styling" },
]

protect_breaking_commits = false
filter_commits = false
tag_pattern = "v[0-9]*\\.[0-9]*\\.[0-9]*"
skip_tags = ""
skip_tags = "-alpha|-beta|-rc\\."
ignore_tags = ""
topo_order = false
sort_commits = "oldest"

0 comments on commit 9e3432f

Please sign in to comment.