From f9550277aec3c89a69e94277da6a4303ccd80d08 Mon Sep 17 00:00:00 2001 From: Fundor333 Date: Wed, 25 Feb 2026 00:18:48 +0100 Subject: [PATCH] Update structure --- makefile | 6 +++++ pyproject.toml | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++ uv.lock | 21 ++++++++++++++- 3 files changed, 95 insertions(+), 1 deletion(-) diff --git a/makefile b/makefile index c4141e5..933695d 100644 --- a/makefile +++ b/makefile @@ -33,3 +33,9 @@ precommit: ## Run pre-commit hooks deploy: ## make the deploy code @uv export --no-hashes --format requirements-txt > requirements.txt + +.PHONY: changelog ## update CHANGELOG.md and amend it on the commit +changelog: + @uv run git-cliff --config pyproject.toml --output CHANGELOG.md + @git add CHANGELOG.md + @git commit --amend --no-edit diff --git a/pyproject.toml b/pyproject.toml index aec74a3..223bf0f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,6 +9,7 @@ dependencies = ["django>=5.2.5"] [dependency-groups] dev = [ + "git-cliff>=2.12.0", "pre-commit>=4.3.0", "pylint>=3.3.8", "pylint-django>=2.6.1", @@ -67,3 +68,71 @@ max-complexity = 18 exclude = [".git", "*migrations*", ".tox", ".venv", ".env"] # Use extend-ignore to add to already ignored checks which are anti-patterns like W503. extend-ignore = ["E501", "W503", "F403", "C901", "B904"] + + +[tool.git-cliff.changelog] +# A Tera template to be rendered as the changelog's header. +# See https://keats.github.io/tera/docs/#introduction +header = """ +# Changelog\n +All notable changes to this project will be documented in this file.\n +""" +# A Tera template to be rendered for each release in the changelog. +# See https://keats.github.io/tera/docs/#introduction +body = """ +{% if version %}\ + ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} +{% else %}\ + ## ๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป๐Ÿง‹ Unreleased +{% endif %}\ +{% for group, commits in commits | unique(attribute="message") | group_by(attribute="group") %} + ### {{ group | upper_first }} + {% for commit in commits %} + - {{ commit.message | split(pat="\n") | first | upper_first | trim_end }}\ + {% endfor %} +{% endfor %} +""" +# A Tera template to be rendered as the changelog's footer. +# See https://keats.github.io/tera/docs/#introduction +footer = """ + +""" +# Remove leading and trailing whitespaces from the changelog's body. +trim = true + +[tool.git-cliff.git] +# Parse commits according to the conventional commits specification. +# See https://www.conventionalcommits.org +conventional_commits = true +# Exclude commits that do not match the conventional commits specification. + + +commit_parsers = [ + + { message = ".\\d+\\.\\d+\\.\\d+", skip = true }, + { message = "^Merge '[^']+' into 'master'", skip = true }, + { message = "^chore\\(release\\): prepare for", skip = true }, + { message = ".*format code with Black.*", skip = true }, + + { message = "^feat", group = "๐Ÿš€ Features" }, + { message = "^fix", group = "๐Ÿ› Bug Fixes" }, + { message = "^doc", group = "๐Ÿ“ Docs" }, + { message = "^perf", group = "๐Ÿงฐ Improvements" }, + { message = "^refactor", group = "๐Ÿงฐ Improvements" }, + { message = "^style", group = "๐Ÿ’„ Style" }, + { message = "^test", group = "๐Ÿงช Testing" }, + { message = "^chore", group = "Miscellaneous Tasks" }, + { body = ".*security", group = "๐Ÿ”’ Security" }, + { body = ".*", group = "โ“ Other (unconventional)" }, +] + +# An array of regex based parsers for extracting data from the commit message.filter_unconventional = false +# Assigns commits to groups. +# Optionally sets the commit's scope and can decide to exclude commits from further processing. +# Exclude commits that are not matched by any commit parser. +filter_commits = true +# Order releases topologically instead of chronologically. +topo_order = false +# Order of commits in each group/release within the changelog. +# Allowed values: newest, oldest +sort_commits = "oldest" diff --git a/uv.lock b/uv.lock index 203e7ae..ec8ee61 100644 --- a/uv.lock +++ b/uv.lock @@ -1,5 +1,5 @@ version = 1 -revision = 2 +revision = 3 requires-python = ">=3.12" [[package]] @@ -80,6 +80,7 @@ dependencies = [ [package.dev-dependencies] dev = [ + { name = "git-cliff" }, { name = "pre-commit" }, { name = "pylint" }, { name = "pylint-django" }, @@ -91,6 +92,7 @@ requires-dist = [{ name = "django", specifier = ">=5.2.5" }] [package.metadata.requires-dev] dev = [ + { name = "git-cliff", specifier = ">=2.12.0" }, { name = "pre-commit", specifier = ">=4.3.0" }, { name = "pylint", specifier = ">=3.3.8" }, { name = "pylint-django", specifier = ">=2.6.1" }, @@ -106,6 +108,23 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/42/14/42b2651a2f46b022ccd948bca9f2d5af0fd8929c4eec235b8d6d844fbe67/filelock-3.19.1-py3-none-any.whl", hash = "sha256:d38e30481def20772f5baf097c122c3babc4fcdb7e14e57049eb9d88c6dc017d", size = 15988, upload-time = "2025-08-14T16:56:01.633Z" }, ] +[[package]] +name = "git-cliff" +version = "2.12.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/90/cf/dff8cd706d2e30e264cb3b9880235607188fb3ad596bfe6282147165bdcd/git_cliff-2.12.0.tar.gz", hash = "sha256:57b96b1f61167f85395353d6f47a89944b4882c03880312d53c09dacecb7ff86", size = 102106, upload-time = "2026-01-20T17:46:12.602Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e3/a5/dc5f800f6a6dc175faa0787653119754dbbe81a9db1274e041443690287b/git_cliff-2.12.0-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:e9ee9aa29e9435211712fdab4b5ec9fb432c4bc9d244e39351b2be57aeba7999", size = 6879200, upload-time = "2026-01-20T17:45:55.964Z" }, + { url = "https://files.pythonhosted.org/packages/d7/b6/0e251bd49700e767c47d8d524a690ad713a3aed4318074278438042b8f25/git_cliff-2.12.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:e18512138db5ef57302155b1163c0a2cf43c3d79071a5e083883b65bb990218c", size = 6456349, upload-time = "2026-01-20T17:45:58.202Z" }, + { url = "https://files.pythonhosted.org/packages/5e/63/4e8780f60ad28e8c26ae2b2b365daff9ffa84cb441a5d5bf62c42a75e75a/git_cliff-2.12.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d24c3e334fdf309c59802ea1a9cd3828e92c8c7cacdd619bcabdc638e00e2ade", size = 6916209, upload-time = "2026-01-20T17:45:59.931Z" }, + { url = "https://files.pythonhosted.org/packages/71/83/0bfab93065e10bcbe97e6136ccf6c1e8552715ef61c11eb678c397ff5fb0/git_cliff-2.12.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f1aa25b05a0315d0f58fc2ac21503538ca749fc3dd7476ee5d6bdf380d9f26ab", size = 7305605, upload-time = "2026-01-20T17:46:01.991Z" }, + { url = "https://files.pythonhosted.org/packages/30/eb/78f624e387c1d9084ca7bcec3a8f28fda9fbbfbeb18c71465a727ee677b5/git_cliff-2.12.0-py3-none-manylinux_2_28_aarch64.whl", hash = "sha256:91eafd2f3ecf226b9a9c2a6c54d96df6042479927b48a97fcf46b728e8744bf1", size = 6927694, upload-time = "2026-01-20T17:46:03.798Z" }, + { url = "https://files.pythonhosted.org/packages/49/3f/735ddcb426c9f77498a039e9398162345c59f29c7990fbf22a530a15fb97/git_cliff-2.12.0-py3-none-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:26c9771a50a039252c67803f4c7f187f2ce9c5eea336b8cef890e94483af7a9d", size = 7118983, upload-time = "2026-01-20T17:46:05.535Z" }, + { url = "https://files.pythonhosted.org/packages/f0/97/68a5bd8063904fc43df7811e713483ccd831a877751283c6514dfb5b079e/git_cliff-2.12.0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:168f48b82f81ab8e1625d42adb739471623e25bd0a7e25b8c70490bad9e90e2b", size = 7541855, upload-time = "2026-01-20T17:46:07.348Z" }, + { url = "https://files.pythonhosted.org/packages/f7/00/2ed0bf7d71340c20906c1317db50cd6c14bdf0c90fa68a62885c9daf40a9/git_cliff-2.12.0-py3-none-win32.whl", hash = "sha256:4bc609a748c1c3493fe3e00a48305d343255ddff80e564fbf8eb954aac387784", size = 6354818, upload-time = "2026-01-20T17:46:09.117Z" }, + { url = "https://files.pythonhosted.org/packages/c0/fd/679d54e4ed37fdbadb58080219af8f35b5f659dd25e47ab1951b6349d1d0/git_cliff-2.12.0-py3-none-win_amd64.whl", hash = "sha256:c992b5756298251ecdd4db8abe087e90d00327f9eaf0c2470a44dbff64377d07", size = 7303564, upload-time = "2026-01-20T17:46:11.154Z" }, +] + [[package]] name = "identify" version = "2.6.13"