Skip to content

Fix/docs#1924

Open
woile wants to merge 4 commits intomasterfrom
fix/docs
Open

Fix/docs#1924
woile wants to merge 4 commits intomasterfrom
fix/docs

Conversation

@woile
Copy link
Copy Markdown
Member

@woile woile commented Apr 5, 2026

Description

  • Closes Broken docs #1922
  • Improves readability of docs
  • Recommend semver2 during init (if not python)

Checklist

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

NO

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

Steps to Test This Pull Request

For the init:

  1. Create new folder with mkdir -p /tmp/app && cd /tmp/app
  2. cz init
  3. Observe

Additional Context

cz bump --yes
```

### `--version-scheme`
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown

codecov bot commented Apr 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.99%. Comparing base (7c21c21) to head (f629d1e).
⚠️ Report is 3 commits behind head on master.
✅ All tests successful. No failed tests found.

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.
📢 Have feedback on the report? Share it here.

@woile woile requested a review from bearomorphism April 5, 2026 09:49
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_scheme details and reorganizing sidebar entries).
  • Change the default version scheme selection for non-Python projects from semver to semver2 (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"]
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
license-files = ["LICENSE"]
license-files = ["LICENSE"]
license = { file = "LICENSE" }

Copilot uses AI. Check for mistakes.
with:
token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"
fetch-depth: 0
ref: ${{ inputs.version || github.ref_name }}
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
ref: ${{ inputs.version || github.ref_name }}
ref: ${{ github.event.inputs.version || github.ref_name }}

Copilot uses AI. Check for mistakes.
Comment on lines +33 to +35
NEW_VERSION: ${{ steps.bump-version.outputs.new_version }}
run: |
cz changelog --dry-run "${NEW_VERSION}" > .changelog.md
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong

Comment on lines +5 to +6
> [!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)
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
> [!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)

Copilot uses AI. Check for mistakes.
Comment on lines +9 to +14
- 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).
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
Comment on lines +219 to +224
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`
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version_provider section has a few inaccuracies/typos:

  • “For a detail explanation” → “For a detailed explanation”.
  • The commitizen provider stores the version in the active Commitizen config (pyproject/.cz.*), not specifically in .cz.toml.
Suggested change
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`

Copilot uses AI. Check for mistakes.

1. Command line:
```sh
cz bump --version-scheme semver
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
cz bump --version-scheme semver
cz bump --version-scheme semver2

Copilot uses AI. Check for mistakes.
cz changelog --incremental
```

This flag can be set in the configuration file with the key `changelog_incremental` under `tool.commitizen`
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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`.

Copilot uses AI. Check for mistakes.
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.

Broken docs

2 participants