|
| 1 | +# configuration file for git-cliff (0.1.0) |
| 2 | + |
| 3 | +[changelog] |
| 4 | +# changelog header |
| 5 | +header = """ |
| 6 | +<!-- THIS FILE IS UPDATED AUTOMATICALLY, ANY CHANGES WILL BE OVERRIDDEN --> |
| 7 | +# Changelog |
| 8 | +All notable changes to Crowsnest will be documented in this file.\n |
| 9 | +""" |
| 10 | +# template for the changelog body |
| 11 | +# https://tera.netlify.app/docs/#introduction |
| 12 | +body = """ |
| 13 | +{% if version %}\ |
| 14 | + ## [{{ version | trim_start_matches(pat="v") }}](https://github.com/mainsail-crew/crowsnest/releases/tag/{{version}}) - {{ timestamp | date(format="%Y-%m-%d") }} |
| 15 | +\ |
| 16 | +{% else %}\ |
| 17 | + ## [unreleased] |
| 18 | +{% endif %}\ |
| 19 | +{% for group, commits in commits | group_by(attribute="group") %}\ |
| 20 | + ### {{ group | striptags | trim | upper_first }} |
| 21 | + {% for commit in commits |
| 22 | + | filter(attribute="scope") |
| 23 | + | sort(attribute="scope") %} |
| 24 | + - **{{commit.scope}}**: {{ commit.message | upper_first | trim }} | [{{ commit.id | truncate(length=7, end="") }}](<REPO>/commit/{{ commit.id }})\ |
| 25 | + {%- if commit.breaking %} |
| 26 | + {% raw %} {% endraw %}- **BREAKING**: {{commit.breaking_description}} |
| 27 | + {%- endif -%} |
| 28 | + {%- endfor -%} |
| 29 | + {%- for commit in commits %} |
| 30 | + {%- if commit.scope -%} |
| 31 | + {% else -%} |
| 32 | + {% raw %}\n{% endraw %}\ |
| 33 | + - {{ commit.message | upper_first | trim }} | [{{ commit.id | truncate(length=7, end="") }}](<REPO>/commit/{{ commit.id }})\ |
| 34 | + {%- if commit.breaking %} |
| 35 | + {% raw %} {% endraw %}- **BREAKING**: {{commit.breaking_description}} |
| 36 | + {%- endif -%} |
| 37 | + {% endif -%} |
| 38 | + {% endfor -%} |
| 39 | + {% raw %}\n{% endraw %} |
| 40 | +{% endfor %}\n\ |
| 41 | +""" |
| 42 | +# remove the leading and trailing whitespaces from the template |
| 43 | +trim = true |
| 44 | +# changelog footer |
| 45 | +footer = """ |
| 46 | +""" |
| 47 | + |
| 48 | +# postprocessors |
| 49 | +postprocessors = [ |
| 50 | + { pattern = '(\(<REPO>/pull/[0-9]+\)\)) \| .+', replace = "${1}" }, |
| 51 | + { pattern = '<REPO>', replace = "https://github.com/mainsail-crew/crowsnest" }, # replace repository URL |
| 52 | +] |
| 53 | + |
| 54 | +[git] |
| 55 | +# allow only conventional commits |
| 56 | +# https://www.conventionalcommits.org |
| 57 | +conventional_commits = true |
| 58 | +filter_unconventional = false |
| 59 | +# regex for parsing and grouping commits |
| 60 | +commit_parsers = [ |
| 61 | + # Commits to skip |
| 62 | + { message = "^docs\\(changelog\\):", group = "Changelog", skip = true}, # Old redundant commits |
| 63 | + { message = "^chore: push version number to", group = "9$Other", skip = true}, # Old redundant commits |
| 64 | + { message = "^chore\\(changelog\\): update changelog", group = "Changelog", skip = true}, # Old redundant commits |
| 65 | + |
| 66 | + # Commits to parse |
| 67 | + { message = "^feat(\\(.*\\))?:", group = "<!-- 1 -->Features"}, |
| 68 | + { message = "^feature(\\(.*\\))?:", group = "<!-- 1 -->Features"}, |
| 69 | + { message = "^fix(\\(.*\\))?:", group = "<!-- 2 -->Bug Fixes and Improvements"}, |
| 70 | + { message = "^perf(\\(.*\\))?:", group = "<!-- 3 -->Performance"}, |
| 71 | + { message = "^refactor(\\(.*\\))?:", group = "<!-- 4 -->Refactor"}, |
| 72 | + { message = "^style(\\(.*\\))?:", group = "<!-- 5 -->Styling"}, |
| 73 | + { message = "^locale(\\(.*\\))?:", group = "<!-- 6 -->Localization"}, |
| 74 | + { message = "^docs(\\(.*\\))?:", group = "<!-- 7 -->Documentation"}, |
| 75 | + { message = "^test(\\(.*\\))?:", group = "<!-- 8 -->Other"}, |
| 76 | + { message = "^chore(\\(.*\\))?:", group = "<!-- 8 -->Other"}, |
| 77 | + { body = ".*security", group = "Security"}, |
| 78 | +] |
| 79 | +commit_preprocessors = [ |
| 80 | + { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/pull/${2}))" }, |
| 81 | +] |
| 82 | +# filter out the commits that are not matched by commit parsers |
| 83 | +filter_commits = true |
| 84 | +ignore_tags="v*-(beta|rc)*" |
| 85 | +# glob pattern for matching git tags |
| 86 | +tag_pattern = "v[0-9]*" |
0 commit comments