Skip to content

docs(customization): verify executable no-bump plugin example - #2098

Open
bearomorphism wants to merge 7 commits into
fm/commitizen-bumprule-prfrom
fm/commitizen-doc-example-checks
Open

bearomorphism wants to merge 7 commits into
fm/commitizen-bumprule-prfrom
fm/commitizen-doc-example-checks

Conversation

@bearomorphism

@bearomorphism bearomorphism commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

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 documented bump_map = {"docs": None} behavior, includes the example in mypy coverage, and tightens the example pattern so fixup!, fixture, and fix! do not silently mis-bump.

During validation, review also surfaced a parent-relative compatibility regression, so this branch restores commitizen.bump.find_increment as a shim and adds a regression test for that public helper without reverting the inherited VersionIncrement work from #2097.

Checklist

Was generative AI tooling used to co-author this PR?

  • Yes (please specify the tool below)

Generated-by: Pi following the guidelines

Code Changes

  • Add test cases to all the changes you introduce
  • Run uv run poe all locally to ensure this change passes linter check and tests
  • Manually test the changes:
    • Verify the feature/bug fix works as expected in real-world scenarios
    • Test edge cases and error conditions
    • Ensure backward compatibility is maintained
    • Document any manual testing steps performed
  • Update the documentation for the changes

Documentation Changes

  • Run uv run poe doc locally to ensure the documentation pages renders correctly
  • Check and fix any broken links (internal or external)

Expected 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 normal fix: commit produces a PATCH increment, and nearby false positives such as fixup!, fixture, and fix! do not silently produce a PATCH bump.

Steps to Test This Pull Request

  1. Run uv run mypy.
  2. Run uv run pytest tests/commands/test_documented_python_class_examples.py tests/test_bump_find_increment.py.
  3. Run uv run mkdocs build.
  4. Confirm docs/customization/python_class.md includes docs/examples/cz_docs_only.py and that the example remains consistent with the tested module.

Additional Context

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

🔍 Commitizen bump preview

Merging this PR will produce the following bump:

bump: version 4.19.0 → 4.19.1
tag to create: v4.19.1
increment detected: PATCH

## v4.19.1 (2026-10-01)

### Fix

- **types**: allow documented None bump_map values

### Refactor

- **bump**: replace find_increment with VersionIncrement max

@codecov

codecov Bot commented Oct 1, 2026

Copy link
Copy Markdown

⚠️ JUnit XML file not found

The CLI was unable to find any JUnit XML files to upload.
For more help, visit our troubleshooting guide.

@bearomorphism bearomorphism changed the title fix(bump): support None-mapped custom bump rules docs(customization): verify executable no-bump plugin example Oct 1, 2026
…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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant