towncrier: add internal category

This commit is contained in:
Gaël Goinvic 2025-01-23 16:24:22 +01:00
parent b4eb6e4fcd
commit aa76225079
No known key found for this signature in database
GPG key ID: 1432A13D0F88CEAF
7 changed files with 12 additions and 6 deletions

View file

@ -0,0 +1 @@
Add internal towncrier change category.

View file

@ -86,3 +86,6 @@ name = "Fixed"
[tool.towncrier.fragment.security]
name = "Security"
[tool.towncrier.fragment.internal]
name = "Internal"

View file

@ -16,12 +16,14 @@ def find_news_fragments(root_dir):
for path in Path(root_dir).glob("*"):
if path.is_file():
new_fragments.append(
{
"description": path.read_text().strip(),
"kind": path.name.split(".")[1],
}
)
kind = path.name.split(".")[1]
if kind != "internal":
new_fragments.append(
{
"description": path.read_text().strip(),
"kind": kind,
}
)
kind_order = ["added", "changed", "removed", "fixed", "security"]
# We order the list by kind and description alphabetically
new_fragments.sort(key=lambda x: str(kind_order.index(x["kind"])) + x["description"])