/ cliff.toml
cliff.toml
 1  # git-cliff ~ configuration file
 2  # https://git-cliff.org/docs/configuration
 3  
 4  [changelog]
 5  # template for the changelog header
 6  header = """
 7  # Changelog\n
 8  All notable changes to this project will be documented in this file.\n
 9  """
10  # template for the changelog body
11  # https://keats.github.io/tera/docs/#introduction
12  body = """
13  {% if version %}\
14      ## {{ version | trim_start_matches(pat="v") }} 
15  {% else %}\
16      ## Unreleased
17  {% endif %}\
18  {% for group, commits in commits | group_by(attribute="group") %}
19      ### {{ group }}\
20      {% for scope, commits in commits | group_by(attribute="scope") %}
21          {% if scope %}\
22          #### {{ scope }}
23          {% endif %}\
24          {% for commit in commits %}
25              {% if scope %}\
26                  - {{ commit.message | replace(from=commit.group ~ "(" ~ commit.scope ~ ")" ~": ", to="") }}
27              {% else %}\
28                  - {{ commit.message | replace(from=commit.group ~ ": ", to="") }}
29              {% endif %}\
30          {% endfor %}\
31      {% endfor %}\
32  {% endfor %}\n
33  """
34  # template for the changelog footer
35  footer = """
36  <!-- generated by git-cliff -->
37  """
38  # remove the leading and trailing whitespace from the templates
39  trim = true
40  
41  [git]
42  # parse the commits based on https://www.conventionalcommits.org
43  conventional_commits = false
44  commit_parsers = [
45    { message = "^([^(:]+)(?:\\(([^)]+)\\))?:\\s*", group = "${1}", scope = "${2}" },
46    { message = "^[^:]+$", group = "Other", scope = "" },
47  ] # regex for parsing and grouping commitssplit_commits = false# process each line of a commit as an individual commitfilter_unconventional = false# filter out the commits that are not conventional
48  # filter out the commits that are not matched by commit parsers
49  filter_commits = false
50  # sort the tags topologically
51  topo_order = false
52  # sort the commits inside sections by oldest/newest order
53  sort_commits = "newest"