Skip to content

Conversation

@bearomorphism
Copy link
Contributor

@bearomorphism bearomorphism commented Nov 19, 2025

Why

docs/config.md basically mixed the usage of options that is only used by different cz commands together. It would be better if those options are categorized.

Also, duplication of option usage documentation occurs. It should be fixed.

This PR categorized and centralizes those configuration file options, and remove the duplication of option usages.

The configuration file doc and version provider doc have their own pages now.

Checklist

Documentation Changes

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

@codecov
Copy link

codecov bot commented Nov 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.68%. Comparing base (120d514) to head (2fa81c7).
⚠️ Report is 852 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1657      +/-   ##
==========================================
+ Coverage   97.33%   98.68%   +1.34%     
==========================================
  Files          42       60      +18     
  Lines        2104     2656     +552     
==========================================
+ Hits         2048     2621     +573     
+ Misses         56       35      -21     
Flag Coverage Δ
unittests 98.68% <ø> (+1.34%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bearomorphism bearomorphism marked this pull request as ready for review November 19, 2025 09:17
@bearomorphism bearomorphism marked this pull request as draft November 19, 2025 13:50
@bearomorphism
Copy link
Contributor Author

bearomorphism commented Nov 19, 2025

I need time to review and improve it.


## Creating a Configuration File

You can create a configuration file manually, or use Commitizen's interactive init command:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
You can create a configuration file manually, or use Commitizen's interactive init command:
You can create a configuration file manually, or use Commitizen's interactive `init` command:

Copy link
Member

Choose a reason for hiding this comment

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

or

Suggested change
You can create a configuration file manually, or use Commitizen's interactive init command:
You can create a configuration file manually, or use Commitizen's interactive initialization command:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

or just remove the init

or "It is recommended to create a configuration file via our cz init command." and add a link to init documentation

Copy link
Member

Choose a reason for hiding this comment

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

or "It is recommended to create a configuration file via our cz init command." and add a link to init documentation

This is also good

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Creating a file manually sounds too advanced..

Copy link
Member

Choose a reason for hiding this comment

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

Or maybe we could add a link to the configuration page and not emphasize the manual creation part too much.

version = "0.1.0" # Managed by Commitizen
```

### `poetry`
Copy link
Member

Choose a reason for hiding this comment

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

I think this only make sense for poetry < 2.0. for poetry >= 2.0, pep621 is suggested

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could you provide details or suggested changes? Thanks!

Copy link
Member

Choose a reason for hiding this comment

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

Yep, the following format is more for poetry < 2.0 or users that need specific poetry features. Most people using poetry >= 2.0 are suggested to use pep621

https://python-poetry.org/blog/announcing-poetry-2.0.0#supporting-the-project-section-in-pyprojecttoml-pep-621


### `uv`

Manages version in both `pyproject.toml` (`project.version`) and `uv.lock` (`package.version` for the matching package name). This ensures consistency between your project metadata and lock file.
Copy link
Member

Choose a reason for hiding this comment

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

It basically follows PEP621, would be better if we mention that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could you provide suggested changes? Thanks

@bearomorphism
Copy link
Contributor Author

Now it is ready for review. I will probably use AI to improve the wording in the documentation in some future PRs.

Let's improve the structure first.

Comment on lines +13 to +19
1. `pyproject.toml` (in the `[tool.commitizen]` section)
2. `.cz.toml`
3. `.cz.json`
4. `cz.json`
5. `.cz.yaml`
6. `cz.yaml`
7. `cz.toml`
Copy link
Member

Choose a reason for hiding this comment

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

Interesting order... but I just verified it's correc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

Yes..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This can be another discussion ... the order doesn't make sense to me

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wonder should we throw a warning if there are multiple cz.* file. Not sure how other tools like eslint or prettier handles multiple configuration file edge case.

Copy link
Member

Choose a reason for hiding this comment

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

Yep, that would be a nice feature. 👍

version = "0.1.0" # Managed by Commitizen
```

### `poetry`
Copy link
Member

Choose a reason for hiding this comment

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

Yep, the following format is more for poetry < 2.0 or users that need specific poetry features. Most people using poetry >= 2.0 are suggested to use pep621

https://python-poetry.org/blog/announcing-poetry-2.0.0#supporting-the-project-section-in-pyprojecttoml-pep-621

Co-authored-by: Wei Lee <weilee.rx@gmail.com>

See [Version Schemes](#version-schemes-version-scheme).

## Avoid raising errors
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this can be in a separate page, like CI tutorial page

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But probably in another PR if we want to do it

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.

2 participants