|
| 1 | +# git-cliff configuration for spectra-gnoland-indexer |
| 2 | +# Tuned to the existing CHANGELOG.md style (Keep a Changelog + Added/Changes/Fixed). |
| 3 | +# Generate the next section with: git cliff --unreleased --tag v0.7.0 |
| 4 | +# Regenerate the whole file with: git cliff -o CHANGELOG.md |
| 5 | + |
| 6 | +[changelog] |
| 7 | +# Static header that matches the existing CHANGELOG.md preamble. |
| 8 | +header = """ |
| 9 | +# Changelog |
| 10 | +
|
| 11 | +All notable changes to this project will be documented in this file. |
| 12 | +
|
| 13 | +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), |
| 14 | +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
| 15 | +""" |
| 16 | + |
| 17 | +# How each release block is rendered. |
| 18 | +body = """ |
| 19 | +{% if version %}\ |
| 20 | +## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} |
| 21 | +{% else %}\ |
| 22 | +## [Unreleased] |
| 23 | +{% endif %}\ |
| 24 | +{% for group, commits in commits | group_by(attribute="group") %} |
| 25 | +### {{ group | striptags | trim | upper_first }} |
| 26 | +{% for commit in commits %} |
| 27 | +- {{ commit.message | upper_first }}\ |
| 28 | +{% if commit.id %} [{{ commit.id | truncate(length=7, end="") }}](https://github.com/Cogwheel-Validator/spectra-gnoland-indexer/commit/{{ commit.id }}){% endif %}\ |
| 29 | +{% endfor %} |
| 30 | +{% endfor %}\n |
| 31 | +""" |
| 32 | +trim = true |
| 33 | + |
| 34 | +[git] |
| 35 | +# For now do not strictly follow Conventional Commits. After v1 this should be changed. |
| 36 | +conventional_commits = false |
| 37 | +filter_unconventional = false |
| 38 | +# Don't split a commit into multiple changelog entries. |
| 39 | +split_commits = false |
| 40 | +# Strip leading/trailing whitespace from messages. |
| 41 | +protect_breaking_commits = false |
| 42 | + |
| 43 | +# Tidy up the subject line before it lands in the changelog: |
| 44 | +# drop the "prefix:" token (we re-group on it below) and the trailing period. |
| 45 | +commit_preprocessors = [ |
| 46 | + { pattern = '^\s*(?i)(add|added|feat|feature|change|changed|chore|deps|dep|refactor|refac|fix|bug|test|vuln|vulncheck|audit| ?fix|fixed|lint|go fmt|go fix|perf|docs|doc|test|ci|build)\s*:\s*', replace = "" }, |
| 47 | + { pattern = '\.\s*$', replace = "" }, |
| 48 | +] |
| 49 | + |
| 50 | +# Map each commit to a group by matching the ORIGINAL prefix. |
| 51 | +# The <!-- N --> markers control section ordering (git-cliff sorts groups by them). |
| 52 | +commit_parsers = [ |
| 53 | + { message = '^\s*(?i)(add|added|feat|feature)\s*:', group = "<!-- 0 -->Added" }, |
| 54 | + { message = '^\s*(?i)(fix|bug ?fix|fixed)\s*:', group = "<!-- 2 -->Fixed" }, |
| 55 | + { message = '^\s*(?i)(change|changed|chore|deps|dep|refactor|refac|lint|go fmt|go fix|perf|build|ci)\s*:', group = "<!-- 1 -->Changes" }, |
| 56 | + { message = '^\s*(?i)(test|audit|vulncheck|vuln)\s*:', group = "<!-- 3 -->Tests and Code Check" }, |
| 57 | + # Anything without a recognised prefix lands here so nothing silently vanishes. |
| 58 | + # Triage these into the right section (or, better, start prefixing your commits). |
| 59 | + { message = '.*', group = "<!-- 3 -->Uncategorized (please triage)" }, |
| 60 | +] |
| 61 | + |
| 62 | +# Process commits newest-first within each group. |
| 63 | +sort_commits = "newest" |
| 64 | +# Only include tags that look like releases. |
| 65 | +tag_pattern = "v[0-9]*" |
0 commit comments