docs(customization): verify executable no-bump plugin example - #2098
Open
bearomorphism wants to merge 7 commits into
Open
bearomorphism wants to merge 7 commits into
bearomorphism wants to merge 7 commits into
Conversation
Contributor
🔍 Commitizen bump previewMerging this PR will produce the following bump: |
|
…nt` compatibility shim from `commitizen/bump.py` and deleted the shim-only regression test file `tests/test_bump_find_increment.py`, preserving the approved docs/example follow-up changes. Verified with `uv run pytest tests/commands/test_documented_python_class_examples.py tests/test_version_increment.py` and `uv run ruff check commitizen/bump.py tests/commands/test_documented_python_class_examples.py tests/test_version_increment.py docs/examples/cz_docs_only.py`
…`commitizen.bump.find_increment` compatibility shim in `commitizen/bump.py`, adding focused regression coverage in `tests/test_bump_find_increment.py`, and protecting the MkDocs snippet block in `docs/customization/python_class.md` from `blacken-docs` rewrites so pre-commit/CI formatting passes. Verified with `uv run pytest tests/test_bump_find_increment.py tests/commands/test_documented_python_class_examples.py -q`, `uv run ruff check ...`, `uv run mypy ...`, `uv run --no-sync prek run --all-files`, `uv run --no-sync poe cover`, and `uv run --no-sync mkdocs build`. Note: the full local `poe ci` sequence still stops at commit-history validation for existing `no-mistakes(...)` commit subjects, which is a non-file-change issue outside this code fix
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This stacked follow-up on #2097 makes the published Python-class bump-rule example executable and verified from a single shared source.
It updates the docs to include
docs/examples/cz_docs_only.py, adds focused runtime tests for the documentedbump_map = {"docs": None}behavior, includes the example in mypy coverage, and tightens the example pattern sofixup!,fixture, andfix!do not silently mis-bump.During validation, review also surfaced a parent-relative compatibility regression, so this branch restores
commitizen.bump.find_incrementas a shim and adds a regression test for that public helper without reverting the inheritedVersionIncrementwork from #2097.Checklist
Was generative AI tooling used to co-author this PR?
Generated-by: Pi following the guidelines
Code Changes
uv run poe alllocally to ensure this change passes linter check and testsDocumentation Changes
uv run poe doclocally to ensure the documentation pages renders correctlyExpected Behavior
The documented custom plugin example is the same Python file that documentation publishes, mypy checks, and the test suite executes. A
docs:commit matched by that example produces no increment, a normalfix:commit produces a PATCH increment, and nearby false positives such asfixup!,fixture, andfix!do not silently produce a PATCH bump.Steps to Test This Pull Request
uv run mypy.uv run pytest tests/commands/test_documented_python_class_examples.py tests/test_bump_find_increment.py.uv run mkdocs build.docs/customization/python_class.mdincludesdocs/examples/cz_docs_only.pyand that the example remains consistent with the tested module.Additional Context
fm/commitizen-bumprule-prNonetyping fix this follow-up builds on: refactor(bump): use VersionIncrement ordering for bump detection #2097