Conversation
| cz bump --yes | ||
| ``` | ||
|
|
||
| ### `--version-scheme` |
There was a problem hiding this comment.
I moved it to the bottom, to have a cohesive view of the cli options.
Eventually, version-scheme should have it's own section, where the differences between pep440 and semver are explained.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1924 +/- ##
=======================================
Coverage 97.99% 97.99%
=======================================
Files 60 60
Lines 2689 2691 +2
=======================================
+ Hits 2635 2637 +2
Misses 54 54 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Pull request overview
This PR updates Commitizen’s documentation structure/readability (addressing broken docs discoverability) and adjusts default versioning guidance/behavior toward semver2 for non-Python projects, alongside CI workflow modernization for bump/release automation.
Changes:
- Update docs navigation and config docs (including adding
version_provider/version_schemedetails and reorganizing sidebar entries). - Change the default version scheme selection for non-Python projects from
semvertosemver2(plus related test updates). - Revise GitHub Actions workflows to bump/tag/release via
cz+gh, and enable manual publish dispatch.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_project_info.py | Updates expectations for default version_scheme to semver2. |
| tests/commands/test_bump_command.py | Formatting-only change to parametrized test ids lambda. |
| pyproject.toml | Updates metadata/deps and build settings; adjusts Commitizen tool config. |
| mkdocs.yml | Reorders configuration nav to improve discoverability. |
| docs/tutorials/github_actions.md | Adds a tip pointing to setup-cz. |
| docs/config/version_provider.md | Spacing/readability tweaks around configuration examples. |
| docs/config/option.md | Renames “Misc” to “General” and expands option descriptions. |
| docs/config/bump.md | Adds version_provider/version_scheme sections and details. |
| docs/commands/changelog.md | Improves option docs with config-file examples and wording. |
| docs/commands/bump.md | Relocates/rewrites --version-scheme docs and examples. |
| commitizen/project_info.py | Defaults non-Python projects to semver2. |
| commitizen/exceptions.py | Adds type annotations for exception attributes. |
| .github/workflows/pythonpublish.yml | Adds workflow_dispatch input and checks out specified ref. |
| .github/workflows/bumpversion.yml | Replaces action-based bump/release with explicit cz + gh steps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { name = "Tim Hsiung", email = "[email protected]" }, | ||
| ] | ||
| license = { file = "LICENSE" } | ||
| license-files = ["LICENSE"] |
There was a problem hiding this comment.
license-files only controls which files get included in the sdist/wheel; it does not declare the project’s license in metadata. Since the previous license = { file = "LICENSE" } and the MIT classifier were removed, the package will no longer advertise a license on PyPI. Consider restoring the license field (or a license-expression) and optionally keep license-files for inclusion.
| license-files = ["LICENSE"] | |
| license-files = ["LICENSE"] | |
| license = { file = "LICENSE" } |
| with: | ||
| token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}" | ||
| fetch-depth: 0 | ||
| ref: ${{ inputs.version || github.ref_name }} |
There was a problem hiding this comment.
inputs.version is only available for workflow_dispatch runs; on tag push runs this context can be undefined and cause expression evaluation to fail. Use github.event.inputs.version (with a fallback to github.ref_name) or gate the expression by event type.
| ref: ${{ inputs.version || github.ref_name }} | |
| ref: ${{ github.event.inputs.version || github.ref_name }} |
| NEW_VERSION: ${{ steps.bump-version.outputs.new_version }} | ||
| run: | | ||
| cz changelog --dry-run "${NEW_VERSION}" > .changelog.md |
There was a problem hiding this comment.
cz changelog --dry-run "${NEW_VERSION}" treats the positional argument as a revision range/version selector and will still render the “Unreleased” header unless --unreleased-version is provided. For GitHub Release notes you likely want --unreleased-version "${NEW_VERSION_TAG}" (tag-formatted) so the notes are labeled with the released version.
| NEW_VERSION: ${{ steps.bump-version.outputs.new_version }} | |
| run: | | |
| cz changelog --dry-run "${NEW_VERSION}" > .changelog.md | |
| NEW_VERSION_TAG: ${{ steps.bump-version.outputs.new_version_tag }} | |
| run: | | |
| cz changelog --dry-run --unreleased-version "${NEW_VERSION_TAG}" > .changelog.md |
| > [!TIP] | ||
| > Check the new [setup-cz](https://github.com/marketplace/actions/setup-commitizen-cli) action, simple and with [examples](https://github.com/commitizen-tools/setup-cz/tree/main/examples) |
There was a problem hiding this comment.
MkDocs Material doesn’t support GitHub-style callouts (> [!TIP]) with the current mkdocs.yml extensions; it will render as a plain blockquote. Use the supported admonition syntax (!!! tip) (or enable a callout extension) so the tip renders correctly in the docs site.
| > [!TIP] | |
| > Check the new [setup-cz](https://github.com/marketplace/actions/setup-commitizen-cli) action, simple and with [examples](https://github.com/commitizen-tools/setup-cz/tree/main/examples) | |
| !!! tip | |
| Check the new [setup-cz](https://github.com/marketplace/actions/setup-commitizen-cli) action, simple and with [examples](https://github.com/commitizen-tools/setup-cz/tree/main/examples) |
| - Options | ||
| - `cz_conventional_commits`: uses [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) | ||
| - `cz_jira`: jira [smart commits](https://support.atlassian.com/bitbucket-cloud/docs/use-smart-commits/) | ||
| - `cz_customize`: (**not recommend**) customize the convention directly in the `TOML` file under `[tool.commitizen.customize]`, read [Customize in configuration file](../customization/config_file.md) for more. There's a plan to provide a different functionality. | ||
|
|
||
| Name of the committing rules to use. | ||
| You can write your own convention, and release it on pypi, check [Customizing through a python class](../customization/python_class.md). |
There was a problem hiding this comment.
The name options list has markdown/grammar issues that harm rendering/readability: - Options should be a proper list label (e.g., - Options:) and (**not recommend**) should be (**not recommended**); also “pypi”/“python” should be capitalized (PyPI/Python).
| For a detail explanation, check the [version provider](./version_provider.md) section. | ||
| Which includes, how to create your own version provider. | ||
|
|
||
| **Available options** | ||
|
|
||
| - `commitizen`: default version provider and stores the version in the `.cz.toml` itself under the key `version` |
There was a problem hiding this comment.
The version_provider section has a few inaccuracies/typos:
- “For a detail explanation” → “For a detailed explanation”.
- The
commitizenprovider stores the version in the active Commitizen config (pyproject/.cz.*), not specifically in.cz.toml.
| For a detail explanation, check the [version provider](./version_provider.md) section. | |
| Which includes, how to create your own version provider. | |
| **Available options** | |
| - `commitizen`: default version provider and stores the version in the `.cz.toml` itself under the key `version` | |
| For a detailed explanation, check the [version provider](./version_provider.md) section. | |
| Which includes, how to create your own version provider. | |
| **Available options** | |
| - `commitizen`: default version provider and stores the version in the active Commitizen config (`pyproject.toml` or `.cz.*`) under the key `version` |
|
|
||
| 1. Command line: | ||
| ```sh | ||
| cz bump --version-scheme semver |
There was a problem hiding this comment.
The --version-scheme examples are inconsistent with the new recommendation of semver2: the command-line example uses semver (v1) while the config example uses semver2. Consider updating the CLI example to cz bump --version-scheme semver2 to avoid confusion.
| cz bump --version-scheme semver | |
| cz bump --version-scheme semver2 |
| cz changelog --incremental | ||
| ``` | ||
|
|
||
| This flag can be set in the configuration file with the key `changelog_incremental` under `tool.commitizen` |
There was a problem hiding this comment.
Missing trailing punctuation on these “can be set/updated in the configuration file…” sentences makes the option docs read like incomplete statements. Consider ending them with a period for consistency with surrounding sections.
| This flag can be set in the configuration file with the key `changelog_incremental` under `tool.commitizen` | |
| This flag can be set in the configuration file with the key `changelog_incremental` under `tool.commitizen`. |
Lee-W
left a comment
There was a problem hiding this comment.
a few question and comments. some suggestion from copilot seems to be correct
| uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
| token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}" |
| GH_TOKEN: ${{ github.token }} | ||
| run: | | ||
| gh workflow run pythonpublish.yml \ | ||
| -f "version=${{ steps.bump-version.outputs.new_version_tag }}" |
There was a problem hiding this comment.
Will it trigger the workflow twice? (trigger it once here and the v... tag triggers another)
|
|
||
|
|
||
| class CommitizenException(Exception): | ||
| exit_code: ExitCode |
Description
semver2duringinit(if not python)Checklist
Was generative AI tooling used to co-author this PR?
NO
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
Steps to Test This Pull Request
For the init:
mkdir -p /tmp/app && cd /tmp/appcz initAdditional Context