-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcliff.toml
More file actions
107 lines (95 loc) · 3.53 KB
/
cliff.toml
File metadata and controls
107 lines (95 loc) · 3.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# cliff.toml - git-cliff configuration for causal-triangulations
#
# This file generates a simple, deterministic *base* changelog from git history.
# The existing Python pipeline (scripts/changelog_utils.py) then applies:
# - Squashed PR expansion
# - Keep a Changelog categorization
# - Breaking-change promotion and other readability tweaks
[changelog]
header = """
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
Generated by [`git-cliff`](https://github.com/orhun/git-cliff).
"""
body = """
{# Release heading #}
{% if version %}
{% set_global release_date = timestamp | date(format="%Y-%m-%d") %}
{% set_global found_release_date = false %}
{% for commit in commits %}
{% set subject = commit.raw_message | split_regex(pat="\r?\n") | first | trim %}
{% if not found_release_date and not (subject is matching("\\(#\\d+\\)$")) %}
{% set_global release_date = commit.author.timestamp | date(format="%Y-%m-%d") %}
{% set_global found_release_date = true %}
{% endif %}
{% endfor %}
{% if previous %}
{% if previous.version %}
## [{{ version }}](https://github.com/acgetchell/causal-triangulations/compare/{{ previous.version }}...{{ version }}) - {{ release_date }}
{% else %}
## {{ version }} - {{ release_date }}
{% endif %}
{% else %}
## {{ version }} - {{ release_date }}
{% endif %}
{% else %}
{% if previous %}
{% if previous.version %}
## [Unreleased](https://github.com/acgetchell/causal-triangulations/compare/{{ previous.version }}...HEAD)
{% else %}
## Unreleased
{% endif %}
{% else %}
## Unreleased
{% endif %}
{% endif %}
{# Merged Pull Requests (squash merges: "Title (#123)") #}
{% set_global printed_merges = false %}
{% for commit in commits %}
{% set subject = commit.raw_message | split_regex(pat="\r?\n") | first | trim %}
{% if subject is matching("\\(#\\d+\\)$") %}
{% if not printed_merges %}
### Merged Pull Requests
{% set_global printed_merges = true %}
{% endif %}
{#
Extract the PR number from the trailing "(#123)" suffix.
Titles may also reference issues earlier (e.g. "Issue #120 ... (#138)") so we
must not grab the first "#..." occurrence.
#}
{% set pr_ref = subject | find_regex(pat="\\(#\\d+\\)$") | first %}
{% set pr_num = pr_ref | replace_regex(from="[^0-9]", to="") %}
{% set pr_title = subject | replace_regex(from="\\s*\\(#\\d+\\)$", to="") %}
- {{ pr_title }} [`#{{ pr_num }}`](https://github.com/acgetchell/causal-triangulations/pull/{{ pr_num }})
{% endif %}
{% endfor %}
{# Changes (exclude the PR-squash commits; those are expanded from the PR list) #}
{% set_global printed_changes_header = false %}
{% for commit in commits %}
{% set lines = commit.raw_message | split_regex(pat="\r?\n") %}
{% set subject = lines | first | trim %}
{% if not (subject is matching("\\(#\\d+\\)$")) %}
{% if not printed_changes_header %}
### Changes
{% set_global printed_changes_header = true %}
{% endif %}
{% set sha = commit.id | truncate(length=7, end="") %}
- **{{ subject }}** [`{{ sha }}`](https://github.com/acgetchell/causal-triangulations/commit/{{ sha }})
{% endif %}
{% endfor %}
"""
trim = true
render_always = true
[git]
conventional_commits = false
filter_unconventional = false
split_commits = false
tag_pattern = "^v[0-9]"
topo_order = false
sort_commits = "newest"
[[git.commit_parsers]]
# Mirror the previous `.auto-changelog.ignoreCommitPattern` exclusions.
message = '^(chore\(release\)|ci\(minor\)|style\(fmt\)|build\(deps\)):'
skip = true