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