Skip to content

Commit 14355aa

Browse files
committed
Deploying to gh-pages from @ b00c86a 🚀
1 parent a799944 commit 14355aa

6 files changed

Lines changed: 250 additions & 52 deletions

File tree

‎faq/index.html‎

Lines changed: 107 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1474,6 +1474,45 @@
14741474
</span>
14751475
</a>
14761476

1477+
</li>
1478+
1479+
<li class="md-nav__item">
1480+
<a href="#why-does-cz-bump-also-change-a-dependency-that-has-the-same-version-as-my-project" class="md-nav__link">
1481+
<span class="md-ellipsis">
1482+
1483+
Why does cz bump also change a dependency that has the same version as my project?
1484+
1485+
</span>
1486+
</a>
1487+
1488+
<nav class="md-nav" aria-label="Why does cz bump also change a dependency that has the same version as my project?">
1489+
<ul class="md-nav__list">
1490+
1491+
<li class="md-nav__item">
1492+
<a href="#option-1-recommended-use-a-version-provider" class="md-nav__link">
1493+
<span class="md-ellipsis">
1494+
1495+
Option 1 (recommended): use a version provider
1496+
1497+
</span>
1498+
</a>
1499+
1500+
</li>
1501+
1502+
<li class="md-nav__item">
1503+
<a href="#option-2-anchor-the-version_files-pattern" class="md-nav__link">
1504+
<span class="md-ellipsis">
1505+
1506+
Option 2: anchor the version_files pattern
1507+
1508+
</span>
1509+
</a>
1510+
1511+
</li>
1512+
1513+
</ul>
1514+
</nav>
1515+
14771516
</li>
14781517

14791518
</ul>
@@ -2182,6 +2221,45 @@
21822221
</span>
21832222
</a>
21842223

2224+
</li>
2225+
2226+
<li class="md-nav__item">
2227+
<a href="#why-does-cz-bump-also-change-a-dependency-that-has-the-same-version-as-my-project" class="md-nav__link">
2228+
<span class="md-ellipsis">
2229+
2230+
Why does cz bump also change a dependency that has the same version as my project?
2231+
2232+
</span>
2233+
</a>
2234+
2235+
<nav class="md-nav" aria-label="Why does cz bump also change a dependency that has the same version as my project?">
2236+
<ul class="md-nav__list">
2237+
2238+
<li class="md-nav__item">
2239+
<a href="#option-1-recommended-use-a-version-provider" class="md-nav__link">
2240+
<span class="md-ellipsis">
2241+
2242+
Option 1 (recommended): use a version provider
2243+
2244+
</span>
2245+
</a>
2246+
2247+
</li>
2248+
2249+
<li class="md-nav__item">
2250+
<a href="#option-2-anchor-the-version_files-pattern" class="md-nav__link">
2251+
<span class="md-ellipsis">
2252+
2253+
Option 2: anchor the version_files pattern
2254+
2255+
</span>
2256+
</a>
2257+
2258+
</li>
2259+
2260+
</ul>
2261+
</nav>
2262+
21852263
</li>
21862264

21872265
</ul>
@@ -2260,6 +2338,34 @@ <h2 id="how-to-avoid-warnings-for-expected-non-version-tags">How to avoid warnin
22602338
<span class="w"> </span><span class="s2">&quot;v${major}.${minor}&quot;</span><span class="p">,</span>
22612339
<span class="p">]</span>
22622340
</code></pre></div>
2341+
<h2 id="why-does-cz-bump-also-change-a-dependency-that-has-the-same-version-as-my-project">Why does <code>cz bump</code> also change a dependency that has the same version as my project?<a class="headerlink" href="#why-does-cz-bump-also-change-a-dependency-that-has-the-same-version-as-my-project" title="Permanent link">&para;</a></h2>
2342+
<p>When an entry in <a href="../config/bump/#version_files"><code>version_files</code></a> has no pattern, or a loose one, Commitizen replaces the current version on every line that matches it.
2343+
If a dependency happens to use the same version string as your project, that line gets bumped too:</p>
2344+
<div class="highlight"><span class="filename">pyproject.toml</span><pre><span></span><code><span class="k">[tool.poetry]</span>
2345+
<span class="n">version</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">&quot;6.1.0&quot;</span>
2346+
2347+
<span class="k">[tool.poetry.dependencies]</span>
2348+
<span class="n">smart-open</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">{</span><span class="n">version</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="s2">&quot;&gt;=5.2.0,&lt;6.1.0&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">extras</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="p">[</span><span class="s2">&quot;s3&quot;</span><span class="p">]}</span><span class="w"> </span><span class="c1"># also becomes &lt;6.2.0</span>
2349+
2350+
<span class="k">[tool.commitizen]</span>
2351+
<span class="n">version</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">&quot;6.1.0&quot;</span>
2352+
<span class="n">version_files</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">[</span><span class="s2">&quot;pyproject.toml:version&quot;</span><span class="p">]</span>
2353+
</code></pre></div>
2354+
<p>There are two ways to avoid this.</p>
2355+
<h3 id="option-1-recommended-use-a-version-provider">Option 1 (recommended): use a version provider<a class="headerlink" href="#option-1-recommended-use-a-version-provider" title="Permanent link">&para;</a></h3>
2356+
<p>Let a <a href="../config/version_provider/">version provider</a> update the version field directly instead of listing the file in <code>version_files</code>.
2357+
Providers edit the exact key (for example <code>tool.poetry.version</code> or <code>project.version</code>), so dependencies are never touched:</p>
2358+
<div class="highlight"><span class="filename">pyproject.toml</span><pre><span></span><code><span class="k">[tool.commitizen]</span>
2359+
<span class="n">version_provider</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">&quot;poetry&quot;</span><span class="w"> </span><span class="c1"># or &quot;pep621&quot;, &quot;uv&quot;, &quot;npm&quot;, &quot;cargo&quot;, ...</span>
2360+
</code></pre></div>
2361+
<p>See also the <a href="#support-for-pep621">PEP621 FAQ entry</a> above.</p>
2362+
<h3 id="option-2-anchor-the-version_files-pattern">Option 2: anchor the <code>version_files</code> pattern<a class="headerlink" href="#option-2-anchor-the-version_files-pattern" title="Permanent link">&para;</a></h3>
2363+
<p>The part after the colon in a <code>version_files</code> entry is a regular expression, matched against each line.
2364+
Anchor it with <code>^</code> so only lines that <em>start</em> with <code>version</code> are updated:</p>
2365+
<div class="highlight"><span class="filename">pyproject.toml</span><pre><span></span><code><span class="k">[tool.commitizen]</span>
2366+
<span class="n">version_files</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">[</span><span class="s2">&quot;pyproject.toml:^version&quot;</span><span class="p">]</span>
2367+
</code></pre></div>
2368+
<p>See <a href="../config/bump/#version_files"><code>version_files</code></a> for more details on the <code>file:pattern</code> syntax.</p>
22632369

22642370

22652371

@@ -2280,7 +2386,7 @@ <h2 id="how-to-avoid-warnings-for-expected-non-version-tags">How to avoid warnin
22802386
<span class="md-icon" title="Last update">
22812387
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21 13.1c-.1 0-.3.1-.4.2l-1 1 2.1 2.1 1-1c.2-.2.2-.6 0-.8l-1.3-1.3c-.1-.1-.2-.2-.4-.2m-1.9 1.8-6.1 6V23h2.1l6.1-6.1zM12.5 7v5.2l4 2.4-1 1L11 13V7zM11 21.9c-5.1-.5-9-4.8-9-9.9C2 6.5 6.5 2 12 2c5.3 0 9.6 4.1 10 9.3-.3-.1-.6-.2-1-.2s-.7.1-1 .2C19.6 7.2 16.2 4 12 4c-4.4 0-8 3.6-8 8 0 4.1 3.1 7.5 7.1 7.9l-.1.2z"/></svg>
22822388
</span>
2283-
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date" title="January 7, 2026 10:36:36 UTC">January 7, 2026</span>
2389+
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date" title="October 6, 2026 22:49:25 UTC">October 6, 2026</span>
22842390
</span>
22852391

22862392

‎faq/index.md‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,49 @@ ignored_tag_formats = [
8686
"v${major}.${minor}",
8787
]
8888
```
89+
90+
## Why does `cz bump` also change a dependency that has the same version as my project?
91+
92+
When an entry in [`version_files`](https://commitizen-tools.github.io/commitizen/config/bump/#version_files) has no pattern, or a loose one, Commitizen replaces the current version on every line that matches it. If a dependency happens to use the same version string as your project, that line gets bumped too:
93+
94+
pyproject.toml
95+
96+
```
97+
[tool.poetry]
98+
version = "6.1.0"
99+
100+
[tool.poetry.dependencies]
101+
smart-open = {version = ">=5.2.0,<6.1.0", extras = ["s3"]} # also becomes <6.2.0
102+
103+
[tool.commitizen]
104+
version = "6.1.0"
105+
version_files = ["pyproject.toml:version"]
106+
```
107+
108+
There are two ways to avoid this.
109+
110+
### Option 1 (recommended): use a version provider
111+
112+
Let a [version provider](https://commitizen-tools.github.io/commitizen/config/version_provider/index.md) update the version field directly instead of listing the file in `version_files`. Providers edit the exact key (for example `tool.poetry.version` or `project.version`), so dependencies are never touched:
113+
114+
pyproject.toml
115+
116+
```
117+
[tool.commitizen]
118+
version_provider = "poetry" # or "pep621", "uv", "npm", "cargo", ...
119+
```
120+
121+
See also the [PEP621 FAQ entry](#support-for-pep621) above.
122+
123+
### Option 2: anchor the `version_files` pattern
124+
125+
The part after the colon in a `version_files` entry is a regular expression, matched against each line. Anchor it with `^` so only lines that *start* with `version` are updated:
126+
127+
pyproject.toml
128+
129+
```
130+
[tool.commitizen]
131+
version_files = ["pyproject.toml:^version"]
132+
```
133+
134+
See [`version_files`](https://commitizen-tools.github.io/commitizen/config/bump/#version_files) for more details on the `file:pattern` syntax.

‎llms-full.txt‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,52 @@ ignored_tag_formats = [
406406
]
407407
```
408408

409+
## Why does `cz bump` also change a dependency that has the same version as my project?
410+
411+
When an entry in [`version_files`](https://commitizen-tools.github.io/commitizen/config/bump/#version_files) has no pattern, or a loose one, Commitizen replaces the current version on every line that matches it. If a dependency happens to use the same version string as your project, that line gets bumped too:
412+
413+
pyproject.toml
414+
415+
```
416+
[tool.poetry]
417+
version = "6.1.0"
418+
419+
[tool.poetry.dependencies]
420+
smart-open = {version = ">=5.2.0,<6.1.0", extras = ["s3"]} # also becomes <6.2.0
421+
422+
[tool.commitizen]
423+
version = "6.1.0"
424+
version_files = ["pyproject.toml:version"]
425+
```
426+
427+
There are two ways to avoid this.
428+
429+
### Option 1 (recommended): use a version provider
430+
431+
Let a [version provider](https://commitizen-tools.github.io/commitizen/config/version_provider/index.md) update the version field directly instead of listing the file in `version_files`. Providers edit the exact key (for example `tool.poetry.version` or `project.version`), so dependencies are never touched:
432+
433+
pyproject.toml
434+
435+
```
436+
[tool.commitizen]
437+
version_provider = "poetry" # or "pep621", "uv", "npm", "cargo", ...
438+
```
439+
440+
See also the [PEP621 FAQ entry](#support-for-pep621) above.
441+
442+
### Option 2: anchor the `version_files` pattern
443+
444+
The part after the colon in a `version_files` entry is a regular expression, matched against each line. Anchor it with `^` so only lines that *start* with `version` are updated:
445+
446+
pyproject.toml
447+
448+
```
449+
[tool.commitizen]
450+
version_files = ["pyproject.toml:^version"]
451+
```
452+
453+
See [`version_files`](https://commitizen-tools.github.io/commitizen/config/bump/#version_files) for more details on the `file:pattern` syntax.
454+
409455
# Exit Codes
410456

411457
Commitizen handles expected exceptions through `CommitizenException` and returns different exit codes for different situations. This reference is useful when you need to ignore specific errors in your CI/CD pipeline or automation scripts.

‎search/search_index.json‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)