|
| 1 | +# git-cliff ~ configuration file |
| 2 | +# https://git-cliff.org/docs/configuration |
| 3 | + |
| 4 | +[changelog] |
| 5 | +# A Tera template to be rendered for each release in the changelog. |
| 6 | +# See https://keats.github.io/tera/docs/#introduction |
| 7 | +body = """\ |
| 8 | +{% macro commit_ref(commit) %}\ |
| 9 | + {% if get_env(name="CHANGELOG_MD", default="false") == "true" %}\ |
| 10 | + [`{{ commit.id | truncate(length=7, end="") }}`](<REPO_URL>/commit/{{ commit.id }})\ |
| 11 | + {% else %}\ |
| 12 | + {{ commit.id | truncate(length=7, end="") }}\ |
| 13 | + {% endif %}\ |
| 14 | +{% endmacro %}\ |
| 15 | +\ |
| 16 | +{%if commits | length > 0 %}\ |
| 17 | + {% if version %}\ |
| 18 | + {% if version is matching("^\\d+\\.\\d+\\.\\d+-\\d+-\\d+$") %}\ |
| 19 | + ## {{ version | trim_start_matches(pat="v") }}\ |
| 20 | + {% else %}\ |
| 21 | + ## {{ version }} - {{ timestamp | date(format="%Y-%m-%d") }}\ |
| 22 | + {% endif %}\ |
| 23 | + {% else %}\ |
| 24 | + ## [unreleased]\ |
| 25 | + {% endif %}\ |
| 26 | +{% endif %}\ |
| 27 | +{% for group, commits in commits | group_by(attribute="group") %} |
| 28 | +
|
| 29 | + ### {{ group | striptags | trim | upper_first }} |
| 30 | + {% for commit in commits %} |
| 31 | + - {% if commit.breaking %}[**BREAKING**] {% endif %}\ |
| 32 | + {{ commit.message | upper_first }} ({{ self::commit_ref(commit=commit) }})\ |
| 33 | + {% endfor %}\ |
| 34 | +{% endfor %} |
| 35 | +{% if previous.version %} |
| 36 | +{% endif %} |
| 37 | +""" |
| 38 | +# Remove leading and trailing whitespaces from the changelog's body. |
| 39 | +trim = true |
| 40 | +# Render body even when there are no releases to process. |
| 41 | +render_always = true |
| 42 | +# An array of regex based postprocessors to modify the changelog. |
| 43 | +postprocessors = [ |
| 44 | + { pattern = '<REPO_URL>', replace = "https://github.com/FoenixRetro/f256-superbasic" }, |
| 45 | +] |
| 46 | +# render body even when there are no releases to process |
| 47 | +# render_always = true |
| 48 | +# output file path |
| 49 | +# output = "test.md" |
| 50 | + |
| 51 | +[git] |
| 52 | +# Parse commits according to the conventional commits specification. |
| 53 | +# See https://www.conventionalcommits.org |
| 54 | +conventional_commits = true |
| 55 | +# Exclude commits that do not match the conventional commits specification. |
| 56 | +filter_unconventional = true |
| 57 | +# Require all commits to be conventional. |
| 58 | +# Takes precedence over filter_unconventional. |
| 59 | +require_conventional = false |
| 60 | +# Split commits on newlines, treating each line as an individual commit. |
| 61 | +split_commits = false |
| 62 | +# An array of regex based parsers to modify commit messages prior to further processing. |
| 63 | +commit_preprocessors = [ |
| 64 | + # Replace issue/PR numbers with link templates, to be updated in `changelog.postprocessors`. |
| 65 | + { pattern = '#([0-9]+)', replace = "[#${1}](<REPO_URL>/issues/${1})" }, |
| 66 | + # Check spelling of the commit message using https://github.com/crate-ci/typos. |
| 67 | + # If the spelling is incorrect, it will be fixed automatically. |
| 68 | + #{ pattern = '.*', replace_command = 'typos --write-changes -' }, |
| 69 | +] |
| 70 | +# Prevent commits that are breaking from being excluded by commit parsers. |
| 71 | +protect_breaking_commits = false |
| 72 | +# An array of regex based parsers for extracting data from the commit message. |
| 73 | +# Assigns commits to groups. |
| 74 | +# Optionally sets the commit's scope and can decide to exclude commits from further processing. |
| 75 | +commit_parsers = [ |
| 76 | + { message = "^feat", group = "<!-- 0 -->Features" }, |
| 77 | + { message = "^fix", group = "<!-- 1 -->Bug fixes" }, |
| 78 | + { message = "^refmanual", group = "<!-- 3 -->Documentation" }, |
| 79 | + { message = "^perf", group = "<!-- 4 -->Performance" }, |
| 80 | + { message = "^chore:\\s+new release\\s*$", skip = true }, |
| 81 | + { message = ".*", group = "<!-- 5 -->Internal" }, |
| 82 | +] |
| 83 | +# Exclude commits that are not matched by any commit parser. |
| 84 | +filter_commits = false |
| 85 | +# An array of link parsers for extracting external references, and turning them into URLs, using regex. |
| 86 | +link_parsers = [] |
| 87 | +# Include only the tags that belong to the current branch. |
| 88 | +use_branch_tags = false |
| 89 | +# Order releases topologically instead of chronologically. |
| 90 | +topo_order = false |
| 91 | +# Order releases topologically instead of chronologically. |
| 92 | +topo_order_commits = true |
| 93 | +# Order of commits in each group/release within the changelog. |
| 94 | +# Allowed values: newest, oldest |
| 95 | +sort_commits = "oldest" |
| 96 | +# Process submodules commits |
| 97 | +recurse_submodules = false |
0 commit comments