Debian Codegraph @

cliff.toml

raw
1 # git-cliff Configuration File
2 # https://git-cliff.org/docs/configuration
3
4 [remote.github]
5 owner = "nicholas-fedor"
6 repo = "shoutrrr"
7
8 [changelog]
9 # ──────────────────────────────────────────────────────────────
10 # A Tera template to be rendered as the changelog's header.
11 # See https://keats.github.io/tera/docs/#introduction
12 # ──────────────────────────────────────────────────────────────
13 header = """
14 <!-- markdownlint-disable MD024 -->
15 # Changelog
16
17 All notable changes to this project will be documented in this file.
18
19 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
20 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
21 """
22
23 # ──────────────────────────────────────────────────────────────
24 # A Tera template to be rendered for each release in the changelog.
25 # See https://keats.github.io/tera/docs/#introduction
26 # ──────────────────────────────────────────────────────────────
27 body = """
28 {%- macro remote_url() -%}
29 https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
30 {%- endmacro -%}
31
32 {% if version %}
33 ## [{{ version | trim_start_matches(pat="v") }}] - {% if commits | length > 0 %}{{ commits[0].committer.timestamp | date(format="%Y-%m-%d") }}{% else %}{{ timestamp | date(format="%Y-%m-%d") }}{% endif %}
34 {% else %}
35 ## [Unreleased]
36 {% endif -%}
37
38 {% for group, commits in commits | group_by(attribute="group") %}
39 ### {{ group | upper_first }}
40 {% for commit in commits %}
41 - {{ commit.message | split(pat="\n") | first | upper_first | trim }}\
42 {% if commit.remote.username %} by @{{ commit.remote.username }}{%- endif -%}
43 {% if commit.remote.pr_number %} in \
44 [#{{ commit.remote.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.remote.pr_number }}) \
45 {%- endif -%}
46 {% endfor %}
47 {% endfor -%}
48
49 {%- if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
50 ### New Contributors
51 {% endif -%}
52
53 {% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
54 - @{{ contributor.username }} made their first contribution\
55 {%- if contributor.pr_number %} in [#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}){%- endif -%}
56 {% endfor %}
57
58 {%- if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}{{"\n"}}{% endif %}
59 """
60
61 # ──────────────────────────────────────────────────────────────
62 # A Tera template to be rendered as the changelog's footer.
63 # See https://keats.github.io/tera/docs/#introduction
64 # ──────────────────────────────────────────────────────────────
65 footer = """
66
67 ## Compare Releases
68
69 {% macro remote_url() -%}
70 https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
71 {%- endmacro -%}
72
73 {% for release in releases -%}
74 {% if release.version -%}
75 {% if release.previous and release.previous.version -%}
76 - [{{ release.version | trim_start_matches(pat="v") }}]({{ self::remote_url() }}/compare/{{ release.previous.version }}...{{ release.version }})
77 {% endif -%}
78 {% else -%}
79 {% if release.previous and release.previous.version -%}
80 - [unreleased]({{ self::remote_url() }}/compare/{{ release.previous.version }}...HEAD)
81 {% endif -%}
82 {% endif -%}
83 {% endfor %}
84 <!-- generated by git-cliff -->
85 """
86
87 # Remove leading and trailing whitespaces from the changelog's body.
88 trim = true
89
90 [git]
91 # Parse commits according to the conventional commits specification.
92 # See https://www.conventionalcommits.org
93 conventional_commits = true
94 # Exclude commits that do not match the conventional commits specification.
95 filter_unconventional = false
96 commit_preprocessors = [{ pattern = '\s*\((\w+\s)?#([0-9]+)\)', replace = "" }]
97 commit_parsers = [
98 # Skip changelog updates (noise from generation/merges)
99 { message = "(?i)update.*changelog", skip = true },
100 { field = "remote.username", pattern = "renovate\\[bot\\]", group = "Chores" },
101 { message = "^chore", group = "Chores" },
102 { message = "^.*: chore", group = "Chores" },
103 { message = "(?i)^fix.*update module", group = "Chores" },
104 { message = "(?i)^fix.*update dependency", group = "Chores" },
105 { message = "(?i)^fix.*bump.*from.*to", group = "Chores" },
106 { message = "(?i)update module", group = "Chores" },
107 { message = "(?i)update dependency", group = "Chores" },
108 { message = "(?i)bump.*from.*to", group = "Chores" },
109 { message = "^fix", group = "Fixed" },
110 { message = "^.*: fix", group = "Fixed" },
111 { message = "^[aA]dd", group = "Added" },
112 { message = "^[sS]upport", group = "Added" },
113 { message = "^[rR]emove", group = "Removed" },
114 { message = "^.*: add", group = "Added" },
115 { message = "^.*: support", group = "Added" },
116 { message = "^.*: remove", group = "Removed" },
117 { message = "^.*: delete", group = "Removed" },
118 { message = "^test", group = "Tests" },
119 { message = "^.*", group = "Changed" },
120 ]
121 # Exclude commits that are not matched by any commit parser.
122 filter_commits = true
123 # Order releases topologically instead of chronologically.
124 topo_order = false
125 # Order of commits in each group/release within the changelog.
126 # Allowed values: newest, oldest
127 sort_commits = "newest"