From d6363a6e1b8c80162bb42999bf323518c8fb7c01 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 18 Jun 2021 21:21:52 +0200 Subject: [PATCH] Update template and use a more power full configuration --- changelog.d/3501.feature | 2 +- tools/towncrier/template.md | 13 +------------ towncrier.toml | 36 ++++++++++++++++++++++++++++++------ 3 files changed, 32 insertions(+), 19 deletions(-) diff --git a/changelog.d/3501.feature b/changelog.d/3501.feature index c0602dda3f..9c89c0e6ae 100644 --- a/changelog.d/3501.feature +++ b/changelog.d/3501.feature @@ -1 +1 @@ -User defined top level spaces ordering (#3501) \ No newline at end of file +User defined top level spaces ordering \ No newline at end of file diff --git a/tools/towncrier/template.md b/tools/towncrier/template.md index fd160682b5..4e5e96a4ac 100644 --- a/tools/towncrier/template.md +++ b/tools/towncrier/template.md @@ -15,19 +15,8 @@ {% if sections[section] %} {% for category, val in definitions.items() if category in sections[section]%} -{% if definitions[category]['name'] == "Features" %} -Features ✨: -{% elif definitions[category]['name'] == "Bugfixes" %} -Bugfixes 🐛: -{% elif definitions[category]['name'] == "Deprecations and Removals" %} -SDK API changes ⚠️: -{% elif definitions[category]['name'] == "Improved Documentation" %} -Improved Documentation 📚: -{% elif definitions[category]['name'] == "Misc" %} -Other changes: -{% else %} {{ definitions[category]['name'] }} -{% endif %} +{{ underline * definitions[category]['name']|length }} {% if definitions[category]['showcontent'] %} {% for text, values in sections[section][category].items() %} - {{ text }} ({{ values|join(', ') }}) diff --git a/towncrier.toml b/towncrier.toml index 58af92ff98..486ef6f186 100644 --- a/towncrier.toml +++ b/towncrier.toml @@ -1,7 +1,31 @@ [tool.towncrier] -directory = "changelog.d" -filename = "CHANGES.md" -name = "Changes in Element" -# Note: there is a bug, if I use title_format, the title is printed twice -# title_format = "Changes in Element {version} ({project_date})" -template="tools/towncrier/template.md" + directory = "changelog.d" + filename = "CHANGES.md" + name = "Changes in Element" + template = "tools/towncrier/template.md" + issue_format = "[#{issue}](https://github.com/vector-im/element-android/issues/{issue})" + + [[tool.towncrier.type]] + directory = "feature" + name = "Features ✨" + showcontent = true + + [[tool.towncrier.type]] + directory = "bugfix" + name = "Bugfixes 🐛" + showcontent = true + + [[tool.towncrier.type]] + directory = "doc" + name = "Improved Documentation 📚" + showcontent = true + + [[tool.towncrier.type]] + directory = "removal" + name = "SDK API changes ⚠️" + showcontent = true + + [[tool.towncrier.type]] + directory = "misc" + name = "Other changes" + showcontent = true