dycw-pre-commit-hooks 0.12.7__tar.gz → 0.12.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dycw_pre_commit_hooks-0.12.7 → dycw_pre_commit_hooks-0.12.8}/PKG-INFO +1 -1
- {dycw_pre_commit_hooks-0.12.7 → dycw_pre_commit_hooks-0.12.8}/pyproject.toml +2 -2
- {dycw_pre_commit_hooks-0.12.7 → dycw_pre_commit_hooks-0.12.8}/src/pre_commit_hooks/__init__.py +1 -1
- {dycw_pre_commit_hooks-0.12.7 → dycw_pre_commit_hooks-0.12.8}/src/pre_commit_hooks/mirror_files/__init__.py +16 -6
- {dycw_pre_commit_hooks-0.12.7 → dycw_pre_commit_hooks-0.12.8}/.gitignore +0 -0
- {dycw_pre_commit_hooks-0.12.7 → dycw_pre_commit_hooks-0.12.8}/README.md +0 -0
- {dycw_pre_commit_hooks-0.12.7 → dycw_pre_commit_hooks-0.12.8}/src/pre_commit_hooks/check_submodules/__init__.py +0 -0
- {dycw_pre_commit_hooks-0.12.7 → dycw_pre_commit_hooks-0.12.8}/src/pre_commit_hooks/check_submodules/__main__.py +0 -0
- {dycw_pre_commit_hooks-0.12.7 → dycw_pre_commit_hooks-0.12.8}/src/pre_commit_hooks/common.py +0 -0
- {dycw_pre_commit_hooks-0.12.7 → dycw_pre_commit_hooks-0.12.8}/src/pre_commit_hooks/format_requirements/__init__.py +0 -0
- {dycw_pre_commit_hooks-0.12.7 → dycw_pre_commit_hooks-0.12.8}/src/pre_commit_hooks/format_requirements/__main__.py +0 -0
- {dycw_pre_commit_hooks-0.12.7 → dycw_pre_commit_hooks-0.12.8}/src/pre_commit_hooks/mirror_files/__main__.py +0 -0
- {dycw_pre_commit_hooks-0.12.7 → dycw_pre_commit_hooks-0.12.8}/src/pre_commit_hooks/py.typed +0 -0
- {dycw_pre_commit_hooks-0.12.7 → dycw_pre_commit_hooks-0.12.8}/src/pre_commit_hooks/replace_sequence_str/__init__.py +0 -0
- {dycw_pre_commit_hooks-0.12.7 → dycw_pre_commit_hooks-0.12.8}/src/pre_commit_hooks/replace_sequence_str/__main__.py +0 -0
- {dycw_pre_commit_hooks-0.12.7 → dycw_pre_commit_hooks-0.12.8}/src/pre_commit_hooks/run_bump_my_version/__init__.py +0 -0
- {dycw_pre_commit_hooks-0.12.7 → dycw_pre_commit_hooks-0.12.8}/src/pre_commit_hooks/run_bump_my_version/__main__.py +0 -0
- {dycw_pre_commit_hooks-0.12.7 → dycw_pre_commit_hooks-0.12.8}/src/pre_commit_hooks/tag_commits/__init__.py +0 -0
- {dycw_pre_commit_hooks-0.12.7 → dycw_pre_commit_hooks-0.12.8}/src/pre_commit_hooks/tag_commits/__main__.py +0 -0
- {dycw_pre_commit_hooks-0.12.7 → dycw_pre_commit_hooks-0.12.8}/src/tests/__init__.py +0 -0
- {dycw_pre_commit_hooks-0.12.7 → dycw_pre_commit_hooks-0.12.8}/src/tests/format_requirements/__init__.py +0 -0
- {dycw_pre_commit_hooks-0.12.7 → dycw_pre_commit_hooks-0.12.8}/src/tests/format_requirements/in.toml +0 -0
- {dycw_pre_commit_hooks-0.12.7 → dycw_pre_commit_hooks-0.12.8}/src/tests/format_requirements/out.toml +0 -0
- {dycw_pre_commit_hooks-0.12.7 → dycw_pre_commit_hooks-0.12.8}/src/tests/format_requirements/test_format_requirements.py +0 -0
- {dycw_pre_commit_hooks-0.12.7 → dycw_pre_commit_hooks-0.12.8}/src/tests/test_main.py +0 -0
|
@@ -31,7 +31,7 @@ dependencies = [
|
|
|
31
31
|
name = "dycw-pre-commit-hooks"
|
|
32
32
|
readme = "README.md"
|
|
33
33
|
requires-python = ">= 3.12"
|
|
34
|
-
version = "0.12.
|
|
34
|
+
version = "0.12.8"
|
|
35
35
|
|
|
36
36
|
[project.scripts]
|
|
37
37
|
check-submodules = "pre_commit_hooks.check_submodules:main"
|
|
@@ -44,7 +44,7 @@ tag-commits = "pre_commit_hooks.tag_commits:main"
|
|
|
44
44
|
# bump-my-version
|
|
45
45
|
[tool.bumpversion]
|
|
46
46
|
allow_dirty = true
|
|
47
|
-
current_version = "0.12.
|
|
47
|
+
current_version = "0.12.8"
|
|
48
48
|
|
|
49
49
|
[[tool.bumpversion.files]]
|
|
50
50
|
filename = "src/pre_commit_hooks/__init__.py"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
from typing import TYPE_CHECKING
|
|
3
|
+
from typing import TYPE_CHECKING, Literal
|
|
4
4
|
|
|
5
5
|
import utilities.click
|
|
6
6
|
from click import argument, command
|
|
@@ -36,11 +36,21 @@ def _process(paths: Iterable[Path], /) -> bool:
|
|
|
36
36
|
|
|
37
37
|
def _process_pair(paths: Iterable[Path], /) -> bool:
|
|
38
38
|
path_from, path_to = paths
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
try:
|
|
40
|
+
text_from = path_from.read_text()
|
|
41
|
+
except FileNotFoundError:
|
|
42
|
+
logger.exception(f"Source file {str(path_from)!r} not found")
|
|
43
|
+
raise
|
|
44
|
+
try:
|
|
45
|
+
text_to = path_to.read_text()
|
|
46
|
+
except FileNotFoundError:
|
|
47
|
+
return _write_text(text_from, path_to)
|
|
48
|
+
return True if text_from == text_to else _write_text(text_from, path_to)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def _write_text(text: str, path: Path, /) -> Literal[False]:
|
|
52
|
+
with writer(path, overwrite=True) as temp:
|
|
53
|
+
_ = temp.write_text(text)
|
|
44
54
|
return False
|
|
45
55
|
|
|
46
56
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dycw_pre_commit_hooks-0.12.7 → dycw_pre_commit_hooks-0.12.8}/src/pre_commit_hooks/common.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dycw_pre_commit_hooks-0.12.7 → dycw_pre_commit_hooks-0.12.8}/src/tests/format_requirements/in.toml
RENAMED
|
File without changes
|
{dycw_pre_commit_hooks-0.12.7 → dycw_pre_commit_hooks-0.12.8}/src/tests/format_requirements/out.toml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|