From fee896e1c81cb9b9a96d53be5648f883cb24a1e9 Mon Sep 17 00:00:00 2001 From: tami5 Date: Wed, 29 Dec 2021 18:35:15 +0300 Subject: [PATCH] feat(changelog): auto-generator --- .github/cliff.toml | 45 ++++++++++++++++++++++++++++++++++++++++++++ CHANGELOG.md | 34 +++++++++++++++++++++++++++++++++ bin/update-changelog | 3 +++ project.clj | 4 +++- 4 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 .github/cliff.toml create mode 100644 CHANGELOG.md create mode 100755 bin/update-changelog diff --git a/.github/cliff.toml b/.github/cliff.toml new file mode 100644 index 0000000..a9673dc --- /dev/null +++ b/.github/cliff.toml @@ -0,0 +1,45 @@ +[changelog] +body = """ +{%- set repo = "https://github.com/tami5/clj-duct-reitit" -%}\ +{% if version %}\ + # 🎉 [{{ version }}]({{ repo }}/tree/{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }} +{% else %}\ + # 🔥 [Unreleased]({{ repo }}) +{% endif %}\ + +{% for group, commits in commits | group_by(attribute="group") %} +## {{ group | upper_first }} +{% for scope, commits in commits | group_by(attribute="scope") %}\n +{% for commit in commits %} +{% if commit.breaking or commit.body %}
{% else %}- {% endif %}\ + {{ scope }} {{ commit.message }} + {%- if commit.breaking or commit.body %}\ + {%- if commit.body %}
\ + {{ commit.body }}{%- endif -%}\ + {%- if commit.breaking %}

\ + BREAKING: {{commit.breaking_description}} + {%- endif -%} +
\n{% endif %} +{%- endfor %} +{% endfor -%} +{% endfor %}\n +""" +trim = false # remove the leading and trailing whitespaces from the template + +[git] +commit_parsers = [ + { message = "^feat", group = "✨ Features", default_scope = "global"}, + { message = "^enh", group = "🌱 Enhancements", default_scope = "global"}, + { message = "^ref", group = "♻️ Refactor", default_scope = "global"}, + { message = "^fix", group = "🐛 Bug Fixes", default_scope = "global"}, + { message = "^doc", group = "📚 Documentation", default_scope = "global"}, + { message = "^test", group = "✅ Testing", default_scope = "global"}, + { message = "^chore", group = "👷 Miscellaneous", default_scope = "global"}, + { body = ".*security", group = "🔒 Security", default_scope = "global"}, + { message = "^chore\\(release\\):", skip = true, default_scope = "global"}, +] +tag_pattern = "[0-9]*" # glob pattern for matching git tags +conventional_commits = true +filter_unconventional = false +filter_commits = false + diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..0a7e4d9 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,34 @@ +# 🔥 [Unreleased](https://github.com/tami5/clj-duct-reitit) + +## ✨ Features + + + +- dev add clj-dev + + + +- module process registry and merge to config +- module use module.registry for passing functions + +## ♻️ Refactor + + + +- module cleanup & readability + +## 📚 Documentation + + + +- readme explain how duct.module/reitit should work +- readme rename reitit/options -> reitit/opts +- readme introduce malli as coercion option + +## ✅ Testing + + + +- module read module configuration + + diff --git a/bin/update-changelog b/bin/update-changelog new file mode 100755 index 0000000..ca49cae --- /dev/null +++ b/bin/update-changelog @@ -0,0 +1,3 @@ +#!/bin/sh + +git-cliff -c .github/cliff.toml > CHANGELOG.md diff --git a/project.clj b/project.clj index 9397765..1379845 100644 --- a/project.clj +++ b/project.clj @@ -16,4 +16,6 @@ :dependencies [[clj-http/clj-http "3.12.3"] [ring/ring-mock "0.4.0"] [tami5/clj-dev "0.1.1"]]}} - :plugins [[cider/cider-nrepl "0.27.3"]]) + :plugins [[cider/cider-nrepl "0.27.3"] + [lein-shell "0.5.0"]] + :aliases {"update-changelog" ["shell" "./bin/update-changelog"]})