-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcliff.toml
More file actions
97 lines (89 loc) · 3.96 KB
/
Copy pathcliff.toml
File metadata and controls
97 lines (89 loc) · 3.96 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
# git-cliff ~ configuration file
# https://git-cliff.org/docs/configuration
[git]
conventional_commits = true # Parse commits based on https://www.conventionalcommits.org
filter_unconventional = true # Exclude non-conventional commits
split_commits = false # Treat each line in a commit as a separate entry
filter_commits = false # Only include commits matched by `commit_parsers`
protect_breaking_commits = true # Keep breaking-change commits from being skipped
sort_commits = "newest" # Order inside sections
tag_pattern = "v[0-9].*"
ignore_tags = "rc|beta|alpha" # Ignored tags' commits roll into the next release
skip_tags = ""
topo_order = false
commit_preprocessors = [
# Link merge request numbers
{ pattern = '\((\w+\s)?[!#]([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))" },
# Collapse repeated spaces
{ pattern = " +", replace = " " },
]
commit_parsers = [
{ message = "^(ci|build|chore)\\(deps.*\\)", skip = true },
{ message = "^chore\\(release\\)", skip = true },
{ message = "^fix\\(deps.*\\): update dependency ([^\\s]+)", scope = "${1}", group = "<!-- 8 -->Dependencies" },
{ message = "^fix\\(deps.*\\)", group = "<!-- 8 -->Dependencies" },
{ message = "^feat", group = "<!-- 0 -->Features" },
{ message = "^fix", group = "<!-- 1 -->Bug fixes" },
{ message = "^refactor", group = "<!-- 2 -->Refactor" },
{ message = "^doc", group = "<!-- 3 -->Documentation" },
{ message = "^perf", group = "<!-- 32 -->Performance" },
{ message = "^build", group = "<!-- 4 -->Build" },
{ body = ".*security", group = "<!-- 5 -->Security" },
{ message = "^test", group = "<!-- 6 -->Testing" },
{ message = "^style", group = "<!-- 62 -->Styling" },
{ message = "^(ci|chore)", group = "<!-- 7 -->Chores" },
{ message = "^revert", group = "<!-- 9 -->Revert" },
]
[changelog]
postprocessors = [{ pattern = '<REPO>', replace = "https://github.com/deadnews/imgup" }]
header = """
# Changelog\n
"""
body = """
{%- macro print_commit(commit) -%}
- {% if commit.scope %}_({{ commit.scope }})_ {% endif %}{% if commit.breaking %}[**breaking**] {% endif %}\
{{ commit.message }} - ([{{ commit.id | truncate(length=7, end="") }}](<REPO>/commit/{{ commit.id }}))
{%- endmacro -%}
{%- macro print_deps_commit(commit) -%}
- {{ commit.message }} - ([{{ commit.id | truncate(length=7, end="") }}](<REPO>/commit/{{ commit.id }}))
{%- endmacro -%}
{%- 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") }}]\
(<REPO>/commits/{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }}
{%- endif -%}
{%- else -%}
## [unreleased]
{%- endif %}
{%- for group, commits in commits | group_by(attribute="group") %}
### {{ group | striptags | trim | upper_first }}
{% if group | striptags | trim | lower == "dependencies" -%}
{%- for scope, scoped_commits in commits | filter(attribute="scope") | group_by(attribute="scope") %}
{{ self::print_deps_commit(commit=scoped_commits | first) }}
{%- endfor -%}
{%- for commit in commits -%}
{%- if not commit.scope %}
{{ self::print_deps_commit(commit=commit) }}
{%- endif -%}
{%- endfor -%}
{%- else -%}
{%- for commit in commits | filter(attribute="scope") | sort(attribute="scope") %}
{{ self::print_commit(commit=commit) }}
{%- endfor -%}
{%- for commit in commits -%}
{%- if not commit.scope %}
{{ self::print_commit(commit=commit) }}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{%- endfor -%}
{% raw %}\n
{% endraw %}
"""
footer = """
<!-- generated by git-cliff -->
"""
trim = true