8000 docs(bump): add example to --check-inconsistency · multimac/commitizen@7c59662 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7c59662

Browse files
committed
docs(bump): add example to --check-inconsistency
1 parent b348828 commit 7c59662

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

docs/bump.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,39 @@ configuration are consistent before bumping version.
9999
cz bump --check-consistency
100100
```
101101

102+
For example, if we have `pyproject.toml`
103+
104+
```toml
105+
[tool.commitizen]
106+
version = "1.21.0"
107+
version_files = [
108+
"src/__version__.py",
109+
"setup.py",
110+
]
111+
```
112+
113+
`src/__version__.py`,
114+
115+
```python
116+
__version__ = "1.21.0"
117+
```
118+
119+
and `setup.py`.
120+
121+
```python
122+
...
123+
version="1.0.5"
124+
...
125+
```
126+
127+
If `--check-consistency` is used, commitizen will check whether the current version in `pyproject.toml`
128+
exists in all version_files and find out it does not exist in `setup.py` and fails.
129+
However, it will still update `pyproject.toml` and `src/__version__.py`.
130+
131+
To fix it, you'll first `git checkout .` to reset to the status before trying to bump and update
132+
the version in `setup.py` to `1.21.0`
133+
134+
102135
## Configuration
103136

104137
### `tag_format`

0 commit comments

Comments
 (0)
0