/ cliff.toml
cliff.toml
 1  # git-cliff ~ configuration file
 2  # https://git-cliff.org/docs/configuration
 3  
 4  [changelog]
 5  header = "# Changelog\n"
 6  # spell-checker: disable
 7  body = """
 8  {% macro commit_refs(commit) %}\
 9  	{% set ref_links = [] -%}\
10  	{% for footer in commit.footers %}\
11  		{% set int_value = footer.value | int(default=-1) %}\
12  		{% if (footer.value is matching("^\\d+$")) and (int_value > 0) and (footer.token in ["close", "closes", "closed", "fix", "fixes", "fixed", "resolve", "resolves", "resolved"]) %}\
13  			{% set encoded_value = int_value | as_str | urlencode_strict %}\
14  			{% set_global ref_links = ref_links | concat(with=("[#" ~ int_value ~ "](https://github.com/hikiko4ern/coub-addons/issues/" ~ encoded_value ~ ")")) %}\
15  		{% endif %}\
16  	{% endfor %}\
17  	{% if ref_links %} ({{ ref_links | unique | join(sep=", ") }}){% endif -%}
18  {% endmacro commit_refs %}\
19  \
20  {% raw %}\n{% endraw %}\
21  {% if version %}\
22      ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
23  {% else %}\
24      ## [unreleased]
25  {% endif %}\
26  {% set breaking_commits = commits | filter(attribute="breaking", value=true) -%}
27  {% if breaking_commits %}
28  	### BREAKING CHANGES
29  	{% for commit in breaking_commits %}
30  			- {{ commit.breaking_description | indent(prefix="  ") }}
31  	{% endfor %}\
32  {% endif %}\
33  {% for group, commits in commits | group_by(attribute="group") %}
34      ### {{ group | striptags | trim | upper_first }}
35      {% for commit in commits %}
36  				{% set related_issues = commit.footers | filter(attribute="token", value="closes") | map(attribute="value") | unique -%}\
37          - {% if commit.breaking %}**\\[breaking\\]** {% endif -%}
38  					{% if commit.scope %}**({{commit.scope}})** {% endif -%}
39  					{{ commit.message }}\
40  					{{ self::commit_refs(commit=commit) }}
41      {%- endfor -%}
42      {% raw %}\n{% endraw %}\
43  {% endfor %}\
44  """
45  # spell-checker: enable
46  trim = true
47  
48  [bump]
49  features_always_bump_minor = false
50  breaking_always_bump_major = false
51  
52  [git]
53  conventional_commits = true
54  filter_unconventional = true
55  split_commits = false
56  commit_parsers = [
57  	# ignore
58  	{ sha = "393a2bbf704825d51c2659e14d42e1d71ed9e325", skip = true }, # feat: initial commit
59  	{ sha = "00bc3be2e3ab07e561d1a20728f9317d5259b44a", skip = true }, # chore: remove `test-extension` from sources zip
60  
61  	# groups
62  	{ message = "^[a-z]+\\((build|changelog|dev|deps|release|utils|internal)(\\)|,)", skip = true },
63  	{ message = "^remove", group = "<!-- 1 -->Removed Features" },
64  	{ message = "^fix", group = "<!-- 2 -->Bug Fixes" },
65  	{ message = "^feat", group = "<!-- 3 -->Features" },
66  	{ message = "^docs", group = "Documentation", skip = true },
67  	{ message = "^perf", group = "Performance" },
68  	{ message = "^refactor", group = "Refactor", skip = true },
69  	{ message = "^style", group = "Styling" },
70  	{ message = "^test", group = "Testing" },
71  	{ message = "^chore", group = "Miscellaneous Tasks" },
72  	{ body = ".*security", group = "<!-- 0 -->Security" },
73  ]
74  protect_breaking_commits = true
75  filter_commits = false
76  tag_pattern = "v[0-9].*"
77  skip_tags = ""
78  ignore_tags = ""
79  # spell-checker: ignore topo
80  topo_order = false
81  sort_commits = "oldest"
82  # fix commit messages
83  commit_preprocessors = [
84  	{ pattern = "^chore\\(docs\\)", replace = "docs" },
85  	{ pattern = "^chore\\(docs,", replace = "docs(" },
86  ]