From ea997587470339c9ff65d2a454e7755507b5aed8 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Fri, 31 Jul 2026 01:07:16 -0700 Subject: [PATCH] bump_version.py: format after edit --- bin/bump_version.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bin/bump_version.py b/bin/bump_version.py index 27ab06b9..54b95a01 100644 --- a/bin/bump_version.py +++ b/bin/bump_version.py @@ -331,6 +331,16 @@ def bump_version() -> None: contents = contents.replace(find, replace) path.write_text(contents, encoding="utf8") + # Format only after every file (including pyproject.toml) reflects the new + # version. Running `uv run` while pyproject.toml still had the old version + # would leave its post-bump environment/lockfile resync to happen for the + # first time during the commit's pre-commit hooks instead of here, which + # then aborts the commit with a spurious "files were modified by this + # hook" error. + for path, _find, _replace in actions: + if path.suffix == ".py": + subprocess.run(["uv", "run", "ruff", "format", str(path)], check=True) + print("Files updated.") print()