|
| 1 | +# git-cliff ~ default configuration file |
| 2 | +# https://git-cliff.org/docs/configuration |
| 3 | +# |
| 4 | +# Lines starting with "#" are comments. |
| 5 | +# Configuration options are organized into tables and keys. |
| 6 | +# See documentation for more information on available options. |
| 7 | + |
| 8 | +[changelog] |
| 9 | +# changelog header |
| 10 | +header = """ |
| 11 | +# Changelog\n |
| 12 | +All notable changes to Tree-Walker will be documented in this file.\n |
| 13 | +""" |
| 14 | +# template for the changelog body |
| 15 | +# https://keats.github.io/tera/docs/#introduction |
| 16 | +body = """ |
| 17 | +{% if version %}\ |
| 18 | + {% if previous.version %}\ |
| 19 | + ## [{{ version | trim_start_matches(pat="v") }}](<REPO>/compare/{{ previous.version }}...{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }} |
| 20 | + {% else %}\ |
| 21 | + ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} |
| 22 | + {% endif %}\ |
| 23 | +{% else %}\ |
| 24 | + ## [unreleased] |
| 25 | +{% endif %}\ |
| 26 | +
|
| 27 | +{% set_global breaking_descriptions = [] %}\ |
| 28 | +{% for commit in commits | filter(attribute="breaking", value=true) %}\ |
| 29 | + {% if commit.breaking_description %}\ |
| 30 | + {% set_global breaking_descriptions = breaking_descriptions | concat(with=commit.breaking_description) %}\ |
| 31 | + {% else %}\ |
| 32 | + {% set_global breaking_descriptions = breaking_descriptions | concat(with=commit.message) %}\ |
| 33 | + {% endif %}\ |
| 34 | +{% endfor %}\ |
| 35 | +{% if breaking_descriptions | length > 0 %} |
| 36 | + ### ⚠ Breaking changes |
| 37 | + {% for description in breaking_descriptions %} |
| 38 | + - {{ description | upper_first }}\ |
| 39 | + {% endfor %} |
| 40 | +{% endif %}\ |
| 41 | +
|
| 42 | +{% for group, commits in commits | group_by(attribute="group") %} |
| 43 | + ### {{ group | striptags | trim | upper_first }} |
| 44 | + {% for commit in commits |
| 45 | + | filter(attribute="scope") |
| 46 | + | sort(attribute="scope") %} |
| 47 | + - **({{commit.scope}})**{% if commit.breaking %} [**breaking**]{% endif %} \ |
| 48 | + {{ commit.message }} - ([{{ commit.id | truncate(length=7, end="") }}](<REPO>/commit/{{ commit.id }})) |
| 49 | + {%- endfor -%} |
| 50 | + {% raw %}\n{% endraw %}\ |
| 51 | + {%- for commit in commits %} |
| 52 | + {%- if commit.scope -%} |
| 53 | + {% else -%} |
| 54 | + - {% if commit.breaking %} [**breaking**]{% endif %}\ |
| 55 | + {{ commit.message }} - ([{{ commit.id | truncate(length=7, end="") }}](<REPO>/commit/{{ commit.id }})) |
| 56 | + {% endif -%} |
| 57 | + {% endfor -%} |
| 58 | +{% endfor %}\n |
| 59 | +""" |
| 60 | +# remove the leading and trailing whitespace from the template |
| 61 | +trim = true |
| 62 | +# changelog footer |
| 63 | +footer = """ |
| 64 | +<!-- generated by git-cliff --> |
| 65 | +""" |
| 66 | +# postprocessors |
| 67 | +postprocessors = [ |
| 68 | + { pattern = '<REPO>', replace = "https://github.com/rezozero/tree-walker" }, |
| 69 | +] |
| 70 | +[git] |
| 71 | +# parse the commits based on https://www.conventionalcommits.org |
| 72 | +conventional_commits = true |
| 73 | +# filter out the commits that are not conventional |
| 74 | +filter_unconventional = true |
| 75 | +# process each line of a commit as an individual commit |
| 76 | +split_commits = false |
| 77 | +# regex for preprocessing the commit messages |
| 78 | +commit_preprocessors = [ |
| 79 | + { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))"}, # replace issue numbers |
| 80 | +] |
| 81 | +# regex for parsing and grouping commits |
| 82 | +commit_parsers = [ |
| 83 | + { message = "^feat(ure)?", group = "Features" }, |
| 84 | + { message = "^fix(es)?", group = "Bug Fixes" }, |
| 85 | + { message = "^docs?", group = "Documentation" }, |
| 86 | + { message = "^perf", group = "Performance" }, |
| 87 | + { message = "^refactor", group = "Refactor" }, |
| 88 | + { message = "^style", group = "Styling" }, |
| 89 | + { message = "^tests?", group = "Testing" }, |
| 90 | + { message = "^chore", skip = true }, |
| 91 | + { message = "^ci", group = "CI/CD" }, |
| 92 | + { body = ".*security", group = "Security" }, |
| 93 | + { message = "^revert", group = "Revert" }, |
| 94 | +] |
| 95 | +# protect breaking changes from being skipped due to matching a skipping commit_parser |
| 96 | +protect_breaking_commits = false |
| 97 | +# filter out the commits that are not matched by commit parsers |
| 98 | +filter_commits = true |
| 99 | +# regex for matching git tags |
| 100 | +tag_pattern = "v?[0-9].*" |
| 101 | + |
| 102 | +# regex for skipping tags |
| 103 | +skip_tags = "v0.1.0-beta.1" |
| 104 | +# regex for ignoring tags |
| 105 | +ignore_tags = "" |
| 106 | +# sort the tags topologically |
| 107 | +topo_order = true |
| 108 | +# sort the commits inside sections by oldest/newest order |
| 109 | +sort_commits = "newest" |
| 110 | +# limit the number of commits included in the changelog. |
| 111 | +# limit_commits = 42 |
0 commit comments