-
Notifications
You must be signed in to change notification settings - Fork 13
/
cliff.toml
122 lines (99 loc) · 4.37 KB
/
cliff.toml
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# Configuration file for git-cliff
[changelog]
# changelog header
header = """
# Changelog
This document provides a list of notable changes introduced in Devolutions Gateway service, installer and Jetsocat.
"""
# template for the changelog body
# https://tera.netlify.app/docs/#introduction
body = """
{% if version -%}
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} ({{ commit_id }})
{%- else -%}
## [Unreleased]
{%- endif %}
{% for group, commits in commits | group_by(attribute="group") -%}
### {{ group | striptags | trim | upper_first }}
{%- for commit in commits %}
{%- if commit.scope %}
{%- set scope = "_" ~ commit.scope ~ "_: " %}
{%- set message = commit.message %}
{%- else %}
{%- set scope = "" %}
{%- set message = commit.message | upper_first %}
{%- endif %}
{%- if commit.breaking %}
{%- set breaking = "[**breaking**] " %}
{%- else %}
{%- set breaking = "" %}
{%- endif %}
{%- set short_sha = commit.id | truncate(length=10, end="") %}
{%- set commit_url = "https://github.com/Devolutions/devolutions-gateway/commit/" ~ commit.id %}
{%- set commit_link = "[" ~ short_sha ~ "](" ~ commit_url ~ ")" %}
{%- if commit.footers %}
{%- set jira_tickets = commit.footers | filter(attribute="token", value="Issue") | map(attribute="value") %}
{%- else %}
{%- set jira_tickets = [] %}
{%- endif %}
- {{scope}}{{breaking}}{{ message }} ({{commit_link}}){% for t in jira_tickets %} ([{{t}}](https://devolutions.atlassian.net/browse/{{t}})){% endfor %} \
{% if commit.body %}\n\n {{ commit.body | replace(from="\n", to="\n ") }}{% endif %}
{%- endfor %}
{% endfor -%}
"""
# remove the leading and trailing whitespace from the template
trim = false
# changelog footer
footer = ""
[git]
# parse the commits based on https://www.conventionalcommits.org
conventional_commits = true
# filter out the commits that are not conventional
filter_unconventional = false
# regex for preprocessing the commit messages
commit_preprocessors = [
# Check spelling of the commit with https://github.com/crate-ci/typos
# If the spelling is incorrect, it will be automatically fixed.
{ pattern = '.*', replace_command = 'typos --write-changes -' },
# Replace issue number with the link
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/Devolutions/devolutions-gateway/issues/${2}))" },
# Replace commit sha1 with the link
{ pattern = '([a-f0-9]{10})([a-f0-9]{30})', replace = "[${0}](https://github.com/Devolutions/devolutions-gateway/commit/${1}${2})" }
]
# regex for parsing and grouping commits
# <!-- <NUMBER> --> is a trick to control the section order: https://github.com/orhun/git-cliff/issues/9#issuecomment-914521594
commit_parsers = [
{ message = "^chore", skip = true },
{ message = "^style", skip = true },
{ message = "^refactor", skip = true },
{ message = "^test", skip = true },
{ message = "^ci", skip = true },
{ message = "^chore\\(release\\): prepare for", skip = true },
{ message = "^chore\\(deps\\)", skip = true },
{ message = "^build\\(deps\\)", skip = true },
{ message = "^.{2,8}\\(.{0,10}nuget.{0,10}\\)", skip = true },
{ message = "^.{2,8}\\(dotnet-.{0,15}\\)", skip = true },
{ message = "^.{2,8}\\(ts-.{0,15}\\)", skip = true },
{ message = "^.{2,8}\\(.{0,10}openapi.{0,10}\\)", skip = true },
{ message = "^.{2,8}\\(.{0,10}npm.{0,10}\\)", skip = true },
{ footer = "^[Cc]hangelog: ?ignore", skip = true },
{ message = "(?i)security", group = "<!-- 0 -->Security" },
{ body = "(?i)security", group = "<!-- 0 -->Security" },
{ footer = "^[Ss]ecurity: ?yes", group = "<!-- 0 -->Security" },
{ message = "^feat", group = "<!-- 1 -->Features" },
{ message = "^revert", group = "<!-- 3 -->Revert" },
{ message = "^fix", group = "<!-- 4 -->Bug Fixes" },
{ message = "^perf", group = "<!-- 5 -->Performance" },
{ message = "^doc", group = "<!-- 6 -->Documentation" },
{ message = "^build", group = "<!-- 7 -->Build" },
{ message = "(?i)improve", group = "<!-- 2 -->Improvements" },
{ message = "(?i)adjust", group = "<!-- 2 -->Improvements" },
{ message = "(?i)change", group = "<!-- 2 -->Improvements" },
{ message = ".*", group = "<!-- 99 -->Please Sort" },
]
# filter out the commits that are not matched by commit parsers
filter_commits = false
# sort the tags chronologically
date_order = false
# sort the commits inside sections by oldest/newest order
sort_commits = "oldest"