Skip to content

Commit 74fc077

Browse files
committed
ci(pre-commit): update pre-commit hooks to latest version and fix detected errors
1 parent b494c55 commit 74fc077

File tree

3 files changed

+23
-22
lines changed

3 files changed

+23
-22
lines changed

.pre-commit-config.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ repos:
1313
- id: check-useless-excludes
1414

1515
- repo: https://github.com/pre-commit/pre-commit-hooks
16-
rev: v4.4.0
16+
rev: v5.0.0
1717
hooks:
1818
- id: check-vcs-permalinks
1919
- id: end-of-file-fixer
@@ -30,13 +30,13 @@ repos:
3030
- id: detect-private-key
3131

3232
- repo: https://github.com/asottile/blacken-docs
33-
rev: 1.13.0
33+
rev: 1.19.1
3434
hooks:
3535
- id: blacken-docs
3636
additional_dependencies: [ black~=23.11 ]
3737

3838
- repo: https://github.com/codespell-project/codespell
39-
rev: v2.2.4
39+
rev: v2.4.1
4040
hooks:
4141
- id: codespell
4242
name: Run codespell to check for common misspellings in files

commitizen/tags.py

+11-9
Original file line numberDiff line numberDiff line change
@@ -55,28 +55,30 @@ class TagRules:
5555
5656
Example:
5757
58-
```py
58+
```python
5959
settings = DEFAULT_SETTINGS.clone()
60-
settings.update({
61-
"tag_format": "v{version}"
62-
"legacy_tag_formats": ["version{version}", "ver{version}"],
63-
"ignored_tag_formats": ["ignored{version}"],
64-
})
60+
settings.update(
61+
{
62+
"tag_format": "v{version}",
63+
"legacy_tag_formats": ["version{version}", "ver{version}"],
64+
"ignored_tag_formats": ["ignored{version}"],
65+
}
66+
)
6567
6668
rules = TagRules.from_settings(settings)
6769
6870
assert rules.is_version_tag("v1.0.0")
6971
assert rules.is_version_tag("version1.0.0")
7072
assert rules.is_version_tag("ver1.0.0")
71-
assert not rules.is_version_tag("ignored1.0.0", warn=True) # Does not warn
72-
assert not rules.is_version_tag("warn1.0.0", warn=True) # Does warn
73+
assert not rules.is_version_tag("ignored1.0.0", warn=True) # Does not warn
74+
assert not rules.is_version_tag("warn1.0.0", warn=True) # Does warn
7375
7476
assert rules.search_version("# My v1.0.0 version").version == "1.0.0"
7577
assert rules.extract_version("v1.0.0") == Version("1.0.0")
7678
try:
7779
assert rules.extract_version("not-a-v1.0.0")
7880
except InvalidVersion:
79-
print "Does not match a tag format"
81+
print("Does not match a tag format")
8082
```
8183
"""
8284

docs/config.md

+9-10
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ Commitizen provides some version providers for some well known formats:
352352
| `scm` | Fetch the version from git and does not need to set it back |
353353
| `pep621` | Get and set version from `pyproject.toml` `project.version` field |
354354
| `poetry` | Get and set version from `pyproject.toml` `tool.poetry.version` field |
355-
| `uv` | Get and set version from `pyproject.toml` `project.version` field and `uv.lock` `pacakge.version` field whose `package.name` field is the same as `pyproject.toml` `project.name` field |
355+
| `uv` | Get and set version from `pyproject.toml` `project.version` field and `uv.lock` `package.version` field whose `package.name` field is the same as `pyproject.toml` `project.name` field |
356356
| `cargo` | Get and set version from `Cargo.toml` `project.version` field |
357357
| `npm` | Get and set version from `package.json` `version` field, `package-lock.json` `version,packages.''.version` fields if the file exists, and `npm-shrinkwrap.json` `version,packages.''.version` fields if the file exists |
358358
| `composer` | Get and set version from `composer.json` `project.version` field |
@@ -386,22 +386,21 @@ class MyProvider(VersionProvider):
386386
387387
def set_version(self, version: str):
388388
self.file.write_text(version)
389-
390389
```
391390

392391
```python title="setup.py"
393392
from setuptools import setup
394393
395394
setup(
396-
name='my-commitizen-provider',
397-
version='0.1.0',
398-
py_modules=['my_provider'],
399-
install_requires=['commitizen'],
400-
entry_points = {
401-
'commitizen.provider': [
402-
'my-provider = my_provider:MyProvider',
395+
name="my-commitizen-provider",
396+
version="0.1.0",
397+
py_modules=["my_provider"],
398+
install_requires=["commitizen"],
399+
entry_points={
400+
"commitizen.provider": [
401+
"my-provider = my_provider:MyProvider",
403402
]
404-
}
403+
},
405404
)
406405
```
407406

0 commit comments

Comments
 (0)