|
| 1 | +# git-cliff ~ configuration file |
| 2 | +# https://git-cliff.org/docs/configuration |
| 3 | + |
| 4 | +[changelog] |
| 5 | +# changelog header |
| 6 | +header = """ |
| 7 | +# Changelog\n |
| 8 | +All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines.\n |
| 9 | +""" |
| 10 | +# template for the changelog body |
| 11 | +# https://keats.github.io/tera/docs/#introduction |
| 12 | +body = """ |
| 13 | +--- |
| 14 | +{% if version %}\ |
| 15 | + {% if previous.version %}\ |
| 16 | + ## [{{ version | trim_start_matches(pat="v") }}]($REPO/compare/{{ previous.version }}..{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }} |
| 17 | + {% else %}\ |
| 18 | + ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} |
| 19 | + {% endif %}\ |
| 20 | +{% else %}\ |
| 21 | + ## [unreleased] |
| 22 | +{% endif %}\ |
| 23 | +{% for group, commits in commits | group_by(attribute="group") %} |
| 24 | + ### {{ group | striptags | trim | upper_first }} |
| 25 | + {% for commit in commits |
| 26 | + | filter(attribute="scope") |
| 27 | + | sort(attribute="scope") %} |
| 28 | + - **({{commit.scope}})**{% if commit.breaking %} [**breaking**]{% endif %} \ |
| 29 | + {{ commit.message|trim }} - ([{{ commit.id | truncate(length=7, end="") }}]($REPO/commit/{{ commit.id }})) - {{ commit.author.name }} |
| 30 | + {%- endfor -%} |
| 31 | + {% raw %}\n{% endraw %}\ |
| 32 | + {%- for commit in commits %} |
| 33 | + {%- if commit.scope -%} |
| 34 | + {% else -%} |
| 35 | + - {% if commit.breaking %} [**breaking**]{% endif %}\ |
| 36 | + {{ commit.message|trim }} - ([{{ commit.id | truncate(length=7, end="") }}]($REPO/commit/{{ commit.id }})) - {{ commit.author.name }} |
| 37 | + {% endif -%} |
| 38 | + {% endfor -%} |
| 39 | +{% endfor %}\n |
| 40 | +""" |
| 41 | +# template for the changelog footer |
| 42 | +footer = """ |
| 43 | +<!-- generated by git-cliff --> |
| 44 | +""" |
| 45 | +# remove the leading and trailing whitespace from the templates |
| 46 | +trim = true |
| 47 | +# postprocessors |
| 48 | +postprocessors = [ |
| 49 | + { pattern = '\$REPO', replace = "https://github.com/qiaopengjun5162/RustWeb3Wallet" }, # replace repository URL |
| 50 | +] |
| 51 | + |
| 52 | +[git] |
| 53 | +# parse the commits based on https://www.conventionalcommits.org |
| 54 | +conventional_commits = true |
| 55 | +# filter out the commits that are not conventional |
| 56 | +filter_unconventional = false |
| 57 | +# process each line of a commit as an individual commit |
| 58 | +split_commits = false |
| 59 | +# regex for preprocessing the commit messages |
| 60 | +commit_preprocessors = [ |
| 61 | + # { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/orhun/git-cliff/issues/${2}))"}, # replace issue numbers |
| 62 | +] |
| 63 | +# regex for parsing and grouping commits |
| 64 | +commit_parsers = [ |
| 65 | + { message = "\\[skip", skip = true }, |
| 66 | + { message = "\\p{Han}", skip = true }, |
| 67 | + { message = "^feat", group = "Features" }, |
| 68 | + { message = "^fix", group = "Bug Fixes" }, |
| 69 | + { message = "^doc", group = "Documentation" }, |
| 70 | + { message = "^perf", group = "Performance" }, |
| 71 | + { message = "^refactor", group = "Refactoring" }, |
| 72 | + { message = "^style", group = "Style" }, |
| 73 | + { message = "^revert", group = "Revert" }, |
| 74 | + { message = "^test", group = "Tests" }, |
| 75 | + { message = "^chore\\(version\\):", skip = true }, |
| 76 | + { message = "^chore", group = "Miscellaneous Chores" }, |
| 77 | + { message = ".*", group = "Other" }, |
| 78 | + { body = ".*security", group = "Security" }, |
| 79 | +] |
| 80 | +# protect breaking changes from being skipped due to matching a skipping commit_parser |
| 81 | +protect_breaking_commits = false |
| 82 | +# filter out the commits that are not matched by commit parsers |
| 83 | +filter_commits = false |
| 84 | +# regex for matching git tags |
| 85 | +tag_pattern = "v[0-9].*" |
| 86 | +# regex for skipping tags |
| 87 | +skip_tags = "v0.1.0-beta.1" |
| 88 | +# regex for ignoring tags |
| 89 | +ignore_tags = "" |
| 90 | +# sort the tags topologically |
| 91 | +topo_order = false |
| 92 | +# sort the commits inside sections by oldest/newest order |
| 93 | +sort_commits = "oldest" |
| 94 | +# limit the number of commits included in the changelog. |
| 95 | +# limit_commits = 42 |
0 commit comments