dycw-pre-commit-hooks 0.12.10__py3-none-any.whl → 0.13.0__py3-none-any.whl

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.

Potentially problematic release.


This version of dycw-pre-commit-hooks might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dycw-pre-commit-hooks
3
- Version: 0.12.10
3
+ Version: 0.13.0
4
4
  Author-email: Derek Wan <d.wan@icloud.com>
5
5
  Requires-Python: >=3.12
6
6
  Requires-Dist: click<8.3,>=8.2.1
@@ -32,8 +32,8 @@ My [`pre-commit`](https://pre-commit.com/) hooks.
32
32
  - repo: https://github.com/dycw/pre-commit-hooks
33
33
  rev: master
34
34
  hooks:
35
- - id: check-submodules
36
35
  - id: format-requirements
36
+ - id: mirror-files
37
37
  - id: replace-sequence-str
38
38
  - id: run-bump-my-version
39
39
  - id: tag-commits
@@ -1,8 +1,6 @@
1
- pre_commit_hooks/__init__.py,sha256=XUa7teN-vfW7cBdLFmZJi5bnnqzvnrGbZY3GK3org8U,60
1
+ pre_commit_hooks/__init__.py,sha256=VX99Js9MSUXrTMe_OSKIYhYYPRRvI_8mU7_0pIpdJmw,59
2
2
  pre_commit_hooks/common.py,sha256=BkGWepSj_y_y6pOrvKX4G8259o5Klp1C-Yg2cdDTi0s,4482
3
3
  pre_commit_hooks/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- pre_commit_hooks/check_submodules/__init__.py,sha256=DJWJHzuYRwTNcx37MoE76X54DzXl9tHFPqSwBr8ckOA,1275
5
- pre_commit_hooks/check_submodules/__main__.py,sha256=foSVebwCfSkKcAc3cD5YTzkmrWd7Wso9_mR9-zuyG-o,153
6
4
  pre_commit_hooks/format_requirements/__init__.py,sha256=ByGP9oCf5c5-55Tayp8BvnT6O-_Fi5om1AAva1BzLvg,3223
7
5
  pre_commit_hooks/format_requirements/__main__.py,sha256=15JSp_rhjI_Ddoj4MRkHFShfnYxs6GggUhLRlGtrQ0E,156
8
6
  pre_commit_hooks/mirror_files/__init__.py,sha256=GSoFXo_og3d7NkQcmzdWOZyxQJPCO1nr4JtMVVcNJOI,1646
@@ -13,7 +11,7 @@ pre_commit_hooks/run_bump_my_version/__init__.py,sha256=FhvLQEEoFm21_2c_12Loy_lc
13
11
  pre_commit_hooks/run_bump_my_version/__main__.py,sha256=w2V3y61jrSau-zxjl8ciHtWPlJQwXbYxNJ2tGYVyI4s,156
14
12
  pre_commit_hooks/tag_commits/__init__.py,sha256=6HWjXOcTd9gjiZwXmy2lIhZzru-zeRgbpEYxKi1z5sg,3294
15
13
  pre_commit_hooks/tag_commits/__main__.py,sha256=qefgYw7LWbvmzZS45-ym6olS4cHqw1Emw2wlqZBXN_o,148
16
- dycw_pre_commit_hooks-0.12.10.dist-info/METADATA,sha256=k9yZ--US0dvsnixJb2nmU1vzM6kMzjHIpnvE9NVmRtw,1106
17
- dycw_pre_commit_hooks-0.12.10.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
18
- dycw_pre_commit_hooks-0.12.10.dist-info/entry_points.txt,sha256=0xGzim6HTjeOXJpusYjBk0aEYkXQR2IwrmfzM6KT_r0,368
19
- dycw_pre_commit_hooks-0.12.10.dist-info/RECORD,,
14
+ dycw_pre_commit_hooks-0.13.0.dist-info/METADATA,sha256=iEdyGf05U2B_FOypZ9Um7DknncrbYhHIdA9_zskLIzU,1101
15
+ dycw_pre_commit_hooks-0.13.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
16
+ dycw_pre_commit_hooks-0.13.0.dist-info/entry_points.txt,sha256=OTVj55u2A6hqtbiPa_h9Zd9pTToCsI9P5xpzE3g4NZc,310
17
+ dycw_pre_commit_hooks-0.13.0.dist-info/RECORD,,
@@ -1,5 +1,4 @@
1
1
  [console_scripts]
2
- check-submodules = pre_commit_hooks.check_submodules:main
3
2
  format-requirements = pre_commit_hooks.format_requirements:main
4
3
  mirror-files = pre_commit_hooks.mirror_files:main
5
4
  replace-sequence-str = pre_commit_hooks.replace_sequence_str:main
@@ -1,3 +1,3 @@
1
1
  from __future__ import annotations
2
2
 
3
- __version__ = "0.12.10"
3
+ __version__ = "0.13.0"
@@ -1,56 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from typing import TYPE_CHECKING
4
-
5
- import utilities.click
6
- from click import argument, command
7
- from git import Repo, Submodule
8
-
9
- from pre_commit_hooks.common import (
10
- DEFAULT_MODE,
11
- Mode,
12
- get_toml_path,
13
- get_version,
14
- mode_option,
15
- run_all,
16
- run_every_option,
17
- throttled_run,
18
- )
19
-
20
- if TYPE_CHECKING:
21
- from pathlib import Path
22
-
23
- from whenever import DateTimeDelta
24
-
25
-
26
- @command()
27
- @argument("paths", nargs=-1, type=utilities.click.Path())
28
- @run_every_option
29
- def main(*, paths: tuple[Path, ...], run_every: DateTimeDelta | None = None) -> bool:
30
- """CLI for the `check-submodules` hook."""
31
- return run_all(
32
- throttled_run("check-submodules", run_every, _process, p) for p in paths
33
- )
34
-
35
-
36
- def _process(path: Path, /) -> bool:
37
- repo = Repo(path, search_parent_directories=True)
38
- return run_all(_process_submodule(s) for s in repo.submodules)
39
-
40
-
41
- def _process_submodule(submodule: Submodule, /) -> bool:
42
- repo = submodule.module()
43
- _ = repo.remotes.origin.fetch()
44
- local = repo.commit("master")
45
- remote = repo.commit("origin/master")
46
- return local.hexsha == remote.hexsha
47
-
48
-
49
- __all__ = [
50
- "DEFAULT_MODE",
51
- "Mode",
52
- "get_toml_path",
53
- "get_version",
54
- "main",
55
- "mode_option",
56
- ]
@@ -1,6 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from pre_commit_hooks.check_submodules import main
4
-
5
- if __name__ == "__main__":
6
- raise SystemExit(int(not main()))