|
| 1 | +# git-cliff configuration (changelog generation) |
| 2 | +# See More: https://git-cliff.org/docs/configuration |
| 3 | + |
| 4 | + |
| 5 | +[changelog] |
| 6 | +# Used by `--prepend` to remove the previous header. |
| 7 | +header_marker = "<!-- git-cliff: end of header -->" |
| 8 | +# A Tera template to be rendered for each release in the changelog. |
| 9 | +# See https://keats.github.io/tera/#getting-started |
| 10 | +# With a GitHub remote (git remote origin), versions link to their compare page |
| 11 | +# and (#123) in commit messages links to the pull request. |
| 12 | +body = """ |
| 13 | +{% set repo = "https://github.com/" ~ remote.github.owner ~ "/" ~ remote.github.repo %}\ |
| 14 | +{% if version %}\ |
| 15 | + ## [{{ version | trim_start_matches(pat="v") }}]\ |
| 16 | + {% if previous.version and remote.github.repo %}({{ repo }}/compare/{{ previous.version }}...{{ version }}){% endif %} - {{ timestamp | date(format="%Y-%m-%d") }} |
| 17 | +{% else %}\ |
| 18 | + ## [unreleased] |
| 19 | +{% endif %}\ |
| 20 | +{% for entry in commits | commit_groups(groups=commit_parsers_groups) %} |
| 21 | + ### {{ entry.group | striptags | trim | upper_first }} |
| 22 | + {% for commit in entry.commits %} |
| 23 | + - {% if commit.scope %}*({{ commit.scope }})* {% endif %}\ |
| 24 | + {% if remote.github.repo %}\ |
| 25 | + {{ commit.message | upper_first | replace_regex(from="\\(#([0-9]+)\\)", to="([#$1](" ~ repo ~ "/pull/$1))") }}\ |
| 26 | + {% else %}\ |
| 27 | + {{ commit.message | upper_first }}\ |
| 28 | + {% endif %}\ |
| 29 | + {% endfor %} |
| 30 | +{% endfor %} |
| 31 | +""" |
| 32 | +# Remove leading and trailing whitespaces from the changelog's body. |
| 33 | +trim = true |
| 34 | +# Render body even when there are no releases to process. |
| 35 | +render_always = true |
| 36 | +# An array of regex based postprocessors to modify the changelog. |
| 37 | +postprocessors = [ |
| 38 | + # End each release with a blank line, so prepended releases are separated. |
| 39 | + { pattern = '\n*\z', replace = "\n\n" }, |
| 40 | + # Replace the placeholder <REPO> with a URL. |
| 41 | + #{ pattern = '<REPO>', replace = "https://github.com/orhun/git-cliff" }, |
| 42 | +] |
| 43 | +# output file path |
| 44 | +# output = "test.md" |
| 45 | + |
| 46 | +[git] |
| 47 | +# Parse commits according to the conventional commits specification. |
| 48 | +# See https://www.conventionalcommits.org |
| 49 | +conventional_commits = true |
| 50 | +# Exclude commits that do not match the conventional commits specification. |
| 51 | +filter_unconventional = true |
| 52 | +# Require all commits to be conventional. |
| 53 | +# Takes precedence over filter_unconventional. |
| 54 | +require_conventional = false |
| 55 | +# Split commits on newlines, treating each line as an individual commit. |
| 56 | +split_commits = false |
| 57 | +# An array of regex based parsers to modify commit messages prior to further processing. |
| 58 | +commit_preprocessors = [ |
| 59 | + # Replace issue numbers with link templates to be updated in `changelog.postprocessors`. |
| 60 | + #{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))"}, |
| 61 | + # Check spelling of the commit message using https://github.com/crate-ci/typos. |
| 62 | + # If the spelling is incorrect, it will be fixed automatically. |
| 63 | + #{ pattern = '.*', replace_command = 'typos --write-changes -' }, |
| 64 | +] |
| 65 | +# Prevent commits that are breaking from being excluded by commit parsers. |
| 66 | +protect_breaking_commits = true |
| 67 | +# An array of regex based parsers for extracting data from the commit message. |
| 68 | +# Assigns commits to groups. |
| 69 | +# Optionally sets the commit's scope and can decide to exclude commits from further processing. |
| 70 | +commit_parsers = [ |
| 71 | + # first, so breaking changes of any type get their own group |
| 72 | + { field = "breaking", pattern = "true", group = "<!-- -1 -->💥 Breaking Changes" }, |
| 73 | + { message = "^bump", skip = true }, |
| 74 | + { message = "^build", skip = true }, |
| 75 | + { message = "^wip", skip = true }, |
| 76 | + { message = "^feat", group = "<!-- 0 -->🚀 Features" }, |
| 77 | + { message = "^fix", group = "<!-- 1 -->🐛 Bug Fixes" }, |
| 78 | + { message = "^doc", group = "<!-- 3 -->📚 Documentation" }, |
| 79 | + { message = "^perf", group = "<!-- 4 -->⚡ Performance" }, |
| 80 | + { message = "^refactor", group = "<!-- 2 -->🚜 Refactor" }, |
| 81 | + { message = "^style", group = "<!-- 5 -->🎨 Styling" }, |
| 82 | + { message = "^test", group = "<!-- 6 -->🧪 Testing" }, |
| 83 | + { message = "^chore\\(release\\): prepare for", skip = true }, |
| 84 | + { message = "^chore\\(deps.*\\)", skip = true }, |
| 85 | + { message = "^chore\\(pr\\)", skip = true }, |
| 86 | + { message = "^chore\\(pull\\)", skip = true }, |
| 87 | + { message = "^chore|^ci", group = "<!-- 7 -->⚙️ Miscellaneous Tasks" }, |
| 88 | + { body = ".*security", group = "<!-- 8 -->🛡️ Security" }, |
| 89 | + { message = "^revert", group = "<!-- 9 -->◀️ Revert" }, |
| 90 | + { message = ".*", group = "<!-- 10 -->💼 Other" }, |
| 91 | +] |
| 92 | +# Exclude commits that are not matched by any commit parser. |
| 93 | +filter_commits = false |
| 94 | +# Fail on a commit that is not matched by any commit parser. |
| 95 | +fail_on_unmatched_commit = false |
| 96 | +# An array of link parsers for extracting external references, and turning them into URLs, using regex. |
| 97 | +link_parsers = [] |
| 98 | +# Leave out releases before 0.4.0 (and their commits), the changelog starts at 0.4.0. |
| 99 | +skip_tags = "v0\\.[0-3]\\..*" |
| 100 | +# Include only the tags that belong to the current branch. |
| 101 | +use_branch_tags = false |
| 102 | +# Order releases topologically instead of chronologically. |
| 103 | +topo_order = false |
| 104 | +# Order commits topologically instead of chronologically. |
| 105 | +topo_order_commits = true |
| 106 | +# Order of commits in each group/release within the changelog. |
| 107 | +# Allowed values: newest, oldest |
| 108 | +sort_commits = "oldest" |
| 109 | +# Process submodules commits |
| 110 | +recurse_submodules = false |
| 111 | + |
| 112 | +[remote] |
| 113 | +# Don't fetch commits and pull requests from the GitHub API, the links only need |
| 114 | +# the repo (from the current branch's upstream, or $GITHUB_REPO in the release workflow). |
| 115 | +offline = true |
0 commit comments