cliff.toml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. # git-cliff configuration file
  2. # https://git-cliff.org/docs/configuration
  3. [changelog]
  4. # changelog header
  5. header = """
  6. # Changelog
  7. All notable changes to this project will be documented in this file.
  8. """
  9. # template for the changelog body
  10. body = """
  11. {% if version %}\
  12. ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
  13. {% else %}\
  14. ## [unreleased]
  15. {% endif %}\
  16. {% for group, commits in commits | group_by(attribute="group") %}
  17. ### {{ group | upper_first }}
  18. {% for commit in commits %}
  19. - {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}
  20. {%- endfor %}
  21. {% endfor %}\n
  22. """
  23. # remove the leading and trailing whitespace from the template
  24. trim = true
  25. # changelog footer
  26. footer = """
  27. """
  28. [git]
  29. # parse the commits based on https://www.conventionalcommits.org
  30. conventional_commits = true
  31. # filter out the commits that are not conventional
  32. filter_unconventional = true
  33. # process each line of a commit as an individual commit
  34. split_commits = false
  35. # regex for preprocessing the commit messages
  36. commit_preprocessors = []
  37. # regex for parsing and grouping commits
  38. commit_parsers = [
  39. { message = "^feat", group = "新功能" },
  40. { message = "^fix", group = "Bug 修复" },
  41. { message = "^docs", group = "文档更新" },
  42. { message = "^perf", group = "性能优化" },
  43. { message = "^refactor", group = "代码重构" },
  44. { message = "^style", group = "代码格式" },
  45. { message = "^test", group = "测试" },
  46. { message = "^chore\\(release\\): prepare for", skip = true },
  47. { message = "^chore.*version", skip = true },
  48. { message = "^chore", group = "其他变更" },
  49. { body = ".*security", group = "安全修复" },
  50. ]
  51. # protect breaking changes from being skipped due to matching a skipping commit_parser
  52. protect_breaking_commits = false
  53. # filter out the commits that are not matched by commit parsers
  54. filter_commits = false
  55. # glob pattern for matching git tags
  56. tag_pattern = "v[0-9]*"
  57. # regex for skipping tags
  58. skip_tags = ""
  59. # regex for ignoring tags
  60. ignore_tags = ""
  61. # sort the tags topologically
  62. topo_order = false
  63. # sort the commits inside sections by oldest/newest order
  64. sort_commits = "oldest"