Skip to content

Commit

Permalink
feat(changelog): auto-generator
Browse files Browse the repository at this point in the history
  • Loading branch information
kkharji committed Dec 29, 2021
1 parent dbddfa9 commit fee896e
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 1 deletion.
45 changes: 45 additions & 0 deletions .github/cliff.toml
Original file line number Diff line number Diff line change
@@ -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 %}<dl><dd><details><summary>{% else %}- {% endif %}\
{{ scope }} <b><a href="{{ repo }}/commit/{{ commit.id }}">{{ commit.message }}</a></b>
{%- if commit.breaking or commit.body %}</summary>\
{%- if commit.body %}<br />\
<sup>{{ commit.body }}</sup>{%- endif -%}\
{%- if commit.breaking %}<br /><br />\
<sup><b>BREAKING</b>: {{commit.breaking_description}}</sup>
{%- endif -%}
</details></dd></dl>\n{% endif %}
{%- endfor %}
{% endfor -%}
{% endfor %}\n
"""
trim = false # remove the leading and trailing whitespaces from the template

[git]
commit_parsers = [
{ message = "^feat", group = "<!-- 0 -->✨ Features", default_scope = "global"},
{ message = "^enh", group = "<!-- 1 -->🌱 Enhancements", default_scope = "global"},
{ message = "^ref", group = "<!-- 2 -->♻️ Refactor", default_scope = "global"},
{ message = "^fix", group = "<!-- 3 -->🐛 Bug Fixes", default_scope = "global"},
{ message = "^doc", group = "<!-- 4 -->📚 Documentation", default_scope = "global"},
{ message = "^test", group = "<!-- 5 -->✅ Testing", default_scope = "global"},
{ message = "^chore", group = "<!-- 6 -->👷 Miscellaneous", default_scope = "global"},
{ body = ".*security", group = "<!-- 7 -->🔒 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

34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# 🔥 [Unreleased](https://github.com/tami5/clj-duct-reitit)

## <!-- 0 -->✨ Features



- dev <b><a href="https://github.com/tami5/clj-duct-reitit/commit/dbddfa9ad5d533525c94f9e95bb7795bccf304d8">add clj-dev</a></b>



- module <b><a href="https://github.com/tami5/clj-duct-reitit/commit/829cbaae4290c0de9d4dd51fd6ead1efdac530a6">process registry and merge to config</a></b>
- module <b><a href="https://github.com/tami5/clj-duct-reitit/commit/7c74c8be0e6ef9e2a59e08e03444cc67298a8bad">use module.registry for passing functions</a></b>

## <!-- 2 -->♻️ Refactor



- module <b><a href="https://github.com/tami5/clj-duct-reitit/commit/87afe9fec9a2ac6651a5f713c31745f00a4fac07">cleanup & readability</a></b>

## <!-- 4 -->📚 Documentation



- readme <b><a href="https://github.com/tami5/clj-duct-reitit/commit/df77cb073e8ed312bc59525d702866704e8cdd54">explain how duct.module/reitit should work</a></b>
- readme <b><a href="https://github.com/tami5/clj-duct-reitit/commit/4f1a09ae045d0ee652aed13156c5b074f6bbe6f1">rename reitit/options -> reitit/opts</a></b>
- readme <b><a href="https://github.com/tami5/clj-duct-reitit/commit/9cec7b8d8a9e0fd5457f9587781ce869bb742362">introduce malli as coercion option</a></b>

## <!-- 5 -->✅ Testing



- module <b><a href="https://github.com/tami5/clj-duct-reitit/commit/3abcd06d0dd65597bc0c53c6d5c077ed5b2a8811">read module configuration</a></b>


3 changes: 3 additions & 0 deletions bin/update-changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

git-cliff -c .github/cliff.toml > CHANGELOG.md
4 changes: 3 additions & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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"]})

0 comments on commit fee896e

Please sign in to comment.