/ cliff.toml
cliff.toml
 1  # yaml-language-server: $schema=https://raw.githubusercontent.com/MarcoIeni/release-plz/refs/heads/main/.schema/latest.json
 2  
 3  [changelog]
 4  render_always = true
 5  use_branch_tags = true
 6  header = """
 7  # Changelog\n
 8  All notable changes to this project will be documented in this file.
 9  """
10  
11  body = """
12  {%- set mapCommitsByDate = commits | unique(attribute="message") | filter(attribute="merge_commit", value=false) | group_by(attribute="extra.date") -%}
13  {%- set_global listCommitsOrderedByDate = [] -%}
14  {%- for commit, ignored in mapCommitsByDate -%}
15      {%- set_global listCommitsOrderedByDate = listCommitsOrderedByDate | concat(with=commit) -%}
16  {% endfor %}
17  {% for commits in listCommitsOrderedByDate | reverse %}
18      ## {{ commits }}
19      {% for group, commits in mapCommitsByDate[commits] | group_by(attribute="group") %}
20          ### {{ group | striptags | trim }}
21          {% for commit in commits %}
22              - {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
23                  {% if commit.breaking %}[**breaking**] {% endif %}\
24                  \\[[{{ commit.id | truncate(length=8, end="") }}](<COMMIT_URL>/{{ commit.id }})\\] {{ commit.message | split(pat="\n") | first | trim }}\
25          {% endfor %}
26      {% endfor %}
27  {% endfor %}
28  """
29  
30  footer = """
31  <!-- generated by git-cliff -->
32  """
33  # remove the leading and trailing s
34  trim = true
35  
36  # postprocessors
37  postprocessors = [
38    { pattern = '<REPO_URL>', replace = "https://github.com/silveiralexf/.dotfiles" },
39    { pattern = '<COMMIT_URL>', replace = "https://github.com/silveiralexf/.dotfiles/commit" },
40    { pattern = "@gmail.com", replace = "" },
41  ]
42  
43  [git]
44  
45  
46  # parse the commits based on https://www.conventionalcommits.org
47  conventional_commits = true
48  # filter out the commits that are not conventional
49  filter_unconventional = true
50  # process each line of a commit as an individual commit
51  split_commits = false
52  # regex for preprocessing the commit messages (normalize old-style commits to reduce conventional-format warnings)
53  commit_preprocessors = [
54    # Normalize legacy [FIX]/[UPDATE] and similar prefixes so they pass conventional-commit check
55    { pattern = "^\\[FIX\\]\\s*", replace = "fix: " },
56    { pattern = "^\\[UPDATE\\]\\s*", replace = "chore: " },
57    { pattern = "^Merge pull request", replace = "chore: Merge pull request" },
58    { pattern = "^Merge branch", replace = "chore: Merge branch" },
59    { pattern = "^[Uu]pdates?(.*)$", replace = "chore: updates$1" },
60    { pattern = "^Updated\\s", replace = "chore: Updated " },
61    { pattern = "^Added\\s", replace = "chore: Added " },
62    { pattern = "^Add\\s", replace = "feat: Add " },
63    { pattern = "^Fixed\\s", replace = "fix: Fixed " },
64    { pattern = "^Improved\\s", replace = "chore: Improved " },
65    { pattern = "^Small\\s", replace = "chore: Small " },
66    { pattern = "^Minor\\s", replace = "chore: Minor " },
67    { pattern = "^remove\\s", replace = "chore: remove " },
68    { pattern = "^[Rr]emove\\s", replace = "chore: Remove " },
69    { pattern = "^[Ii]nitial\\s", replace = "chore: Initial " },
70    # Original preprocessors
71    { pattern = "  +", replace = " " },
72    { pattern = "https://github.com/.*/issues/([0-9]+)", replace = "[Issue #${1}]" },
73    { pattern = "Former-commit-id:.*", replace = "" },
74    { pattern = "\n\n$", replace = "" },
75  ]
76  # regex for parsing and grouping commits
77  commit_parsers = [
78    { message = "^hack", skip = true },
79    { message = ".*deps.*", group = "<!-- 10 -->๐Ÿ“ฆ Dependencies" },
80    { message = "^feat", group = "<!-- 0 -->๐Ÿš€ Features" },
81    { message = "^fix", group = "<!-- 7 -->๐Ÿ”จ Fixes" },
82    { message = "^refactor", group = "<!-- 2 --> ๐Ÿญ Refactor" },
83    { message = "^doc", group = "<!-- 3 -->๐Ÿ“š Documentation" },
84    { message = "^perf", group = "<!-- 4 -->โšก Performance" },
85    { message = "^style|^lint", group = "<!-- 5 -->๐ŸŽจ Styling" },
86    { message = "^test", group = "<!-- 6 -->๐Ÿงช Testing" },
87    { body = ".*security", group = "<!-- 8 -->๐Ÿ›ก๏ธ Security" },
88    { message = "^revert", group = "<!-- 9 -->โ—€๏ธ Revert" },
89    { message = "^chore|^ci|\\(ci\\)", group = "<!-- 8 -->โš™๏ธ Chores" },
90  ]
91  
92  # filter out the commits that are not matched by commit parsers
93  filter_commits = true
94  # sort the tags topologically
95  topo_order = false
96  # sort the commits inside sections by oldest/newest order
97  sort_commits = "newest"