|
| 1 | +# git-cliff ~ configuration file |
| 2 | +# https://git-cliff.org/docs/configuration |
| 3 | + |
| 4 | + |
| 5 | +[changelog] |
| 6 | +# A Tera template to be rendered as the changelog's footer. |
| 7 | +# See https://keats.github.io/tera/docs/#introduction |
| 8 | +header = """ |
| 9 | +# Changelog\n |
| 10 | +All notable changes to this project will be documented in this file.\n |
| 11 | +""" |
| 12 | +# A Tera template to be rendered for each release in the changelog. |
| 13 | +# See https://keats.github.io/tera/docs/#introduction |
| 14 | +body = """ |
| 15 | +{%- macro remote_url() -%} |
| 16 | + https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} |
| 17 | +{%- endmacro -%} |
| 18 | +
|
| 19 | +{% macro print_commit(commit) -%} |
| 20 | + - {% if commit.scope %}*({{ commit.scope }})* {% endif %}\ |
| 21 | + {% if commit.breaking %}[**breaking**] {% endif %}\ |
| 22 | + {{ commit.message | upper_first }} - \ |
| 23 | + ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ |
| 24 | + {% if commit.remote.username %} by @{{ commit.remote.username }}{%- endif -%} |
| 25 | + {% if commit.remote.pr_number %} in \ |
| 26 | + [#{{ commit.remote.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.remote.pr_number }}) \ |
| 27 | + {%- endif %} |
| 28 | +{% endmacro -%} |
| 29 | +
|
| 30 | +{% if version %}\ |
| 31 | + {% if previous.version %}\ |
| 32 | + ## [{{ version | trim_start_matches(pat="v") }}]\ |
| 33 | + ({{ self::remote_url() }}/compare/{{ previous.version }}..{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }} |
| 34 | + {% else %}\ |
| 35 | + ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} |
| 36 | + {% endif %}\ |
| 37 | +{% else %}\ |
| 38 | + ## [unreleased] |
| 39 | +{% endif %}\ |
| 40 | +
|
| 41 | +{% for group, commits in commits | group_by(attribute="group") %} |
| 42 | + ### {{ group | striptags | trim | upper_first }} |
| 43 | + {% for commit in commits |
| 44 | + | filter(attribute="scope") |
| 45 | + | sort(attribute="scope") %} |
| 46 | + {{ self::print_commit(commit=commit) }} |
| 47 | + {%- endfor %} |
| 48 | + {% for commit in commits %} |
| 49 | + {%- if not commit.scope -%} |
| 50 | + {{ self::print_commit(commit=commit) }} |
| 51 | + {% endif -%} |
| 52 | + {% endfor -%} |
| 53 | +{% endfor -%} |
| 54 | +{%- if github -%} |
| 55 | +{% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %} |
| 56 | + ## New Contributors β€οΈ |
| 57 | +{% endif %}\ |
| 58 | +{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %} |
| 59 | + * @{{ contributor.username }} made their first contribution |
| 60 | + {%- if contributor.pr_number %} in \ |
| 61 | + [#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \ |
| 62 | + {%- endif %} |
| 63 | +{%- endfor -%} |
| 64 | +{%- endif %} |
| 65 | +
|
| 66 | +""" |
| 67 | +# A Tera template to be rendered as the changelog's footer. |
| 68 | +# See https://keats.github.io/tera/docs/#introduction |
| 69 | +footer = """ |
| 70 | +<!-- generated by git-cliff --> |
| 71 | +""" |
| 72 | +# Remove leading and trailing whitespaces from the changelog's body. |
| 73 | +trim = true |
| 74 | +# Render body even when there are no releases to process. |
| 75 | +render_always = true |
| 76 | +# An array of regex based postprocessors to modify the changelog. |
| 77 | +postprocessors = [ |
| 78 | + # Replace the placeholder <REPO> with a URL. |
| 79 | + #{ pattern = '<REPO>', replace = "https://github.com/orhun/git-cliff" }, |
| 80 | +] |
| 81 | +# render body even when there are no releases to process |
| 82 | +# render_always = true |
| 83 | +# output file path |
| 84 | +# output = "test.md" |
| 85 | + |
| 86 | +[git] |
| 87 | +# Parse commits according to the conventional commits specification. |
| 88 | +# See https://www.conventionalcommits.org |
| 89 | +conventional_commits = true |
| 90 | +# Exclude commits that do not match the conventional commits specification. |
| 91 | +filter_unconventional = true |
| 92 | +# Require all commits to be conventional. |
| 93 | +# Takes precedence over filter_unconventional. |
| 94 | +require_conventional = false |
| 95 | +# Split commits on newlines, treating each line as an individual commit. |
| 96 | +split_commits = false |
| 97 | +# An array of regex based parsers to modify commit messages prior to further processing. |
| 98 | +commit_preprocessors = [ |
| 99 | + # Replace issue numbers with link templates to be updated in `changelog.postprocessors`. |
| 100 | + #{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))"}, |
| 101 | + # Check spelling of the commit message using https://github.com/crate-ci/typos. |
| 102 | + # If the spelling is incorrect, it will be fixed automatically. |
| 103 | + #{ pattern = '.*', replace_command = 'typos --write-changes -' }, |
| 104 | +] |
| 105 | +# Prevent commits that are breaking from being excluded by commit parsers. |
| 106 | +protect_breaking_commits = false |
| 107 | +# An array of regex based parsers for extracting data from the commit message. |
| 108 | +# Assigns commits to groups. |
| 109 | +# Optionally sets the commit's scope and can decide to exclude commits from further processing. |
| 110 | +commit_parsers = [ |
| 111 | + { message = "^feat", group = "<!-- 0 -->π Features" }, |
| 112 | + { message = "^fix", group = "<!-- 1 -->π Bug Fixes" }, |
| 113 | + { message = "^docs", group = "<!-- 3 -->π Documentation" }, |
| 114 | + { message = "^perf", group = "<!-- 4 -->β‘ Performance" }, |
| 115 | + { message = "^refactor", group = "<!-- 2 -->π Refactor" }, |
| 116 | + { message = "^style", group = "<!-- 5 -->π¨ Styling" }, |
| 117 | + { message = "^test", group = "<!-- 6 -->π§ͺ Testing" }, |
| 118 | + { message = "^chore\\(release\\): prepare for", skip = true }, |
| 119 | + { message = "^chore\\(deps.*\\)", skip = true }, |
| 120 | + { message = "^chore\\(pr\\)", skip = true }, |
| 121 | + { message = "^chore\\(pull\\)", skip = true }, |
| 122 | + { message = "^chore|^ci", group = "<!-- 7 -->βοΈ Miscellaneous Tasks" }, |
| 123 | + { body = ".*security", group = "<!-- 8 -->π‘οΈ Security" }, |
| 124 | + { message = "^revert", group = "<!-- 9 -->βοΈ Revert" }, |
| 125 | + { message = ".*", group = "<!-- 10 -->πΌ Other" }, |
| 126 | +] |
| 127 | +# Exclude commits that are not matched by any commit parser. |
| 128 | +filter_commits = false |
| 129 | +# An array of link parsers for extracting external references, and turning them into URLs, using regex. |
| 130 | +link_parsers = [] |
| 131 | +# Include only the tags that belong to the current branch. |
| 132 | +use_branch_tags = false |
| 133 | +# Order releases topologically instead of chronologically. |
| 134 | +topo_order = false |
| 135 | +# Order releases topologically instead of chronologically. |
| 136 | +topo_order_commits = true |
| 137 | +# Order of commits in each group/release within the changelog. |
| 138 | +# Allowed values: newest, oldest |
| 139 | +sort_commits = "oldest" |
| 140 | +# Process submodules commits |
| 141 | +recurse_submodules = false |
0 commit comments