dycw-pre-commit-hooks 0.12.8__py3-none-any.whl → 0.12.9__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.8
3
+ Version: 0.12.9
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
@@ -1,7 +1,7 @@
1
- pre_commit_hooks/__init__.py,sha256=YLG1ztMLECr37VVZERdQ_nviI-TnuwzwSfl9cBayIv8,59
1
+ pre_commit_hooks/__init__.py,sha256=_SME_z9OS6vGtaQHag719-IQtmnJ3bfHioDbLCdRoMo,59
2
2
  pre_commit_hooks/common.py,sha256=Ovg0kK5CBSBEalGdVxLKjvRX3gbjpzTFRNRopB8tEiw,4247
3
3
  pre_commit_hooks/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- pre_commit_hooks/check_submodules/__init__.py,sha256=8aJ6sbDclOML5uahK4TNf80Sxf6gCx1kIOYwkv37g9s,1092
4
+ pre_commit_hooks/check_submodules/__init__.py,sha256=Q9iuPFQvpCJmuHlPbPDzd5zgua3pS0ZBka0JFpNpbOs,1324
5
5
  pre_commit_hooks/check_submodules/__main__.py,sha256=foSVebwCfSkKcAc3cD5YTzkmrWd7Wso9_mR9-zuyG-o,153
6
6
  pre_commit_hooks/format_requirements/__init__.py,sha256=dORQ5sNZaOWYY6cw0X1YIic4OHZeTt9EhI21D1uQFyE,3322
7
7
  pre_commit_hooks/format_requirements/__main__.py,sha256=15JSp_rhjI_Ddoj4MRkHFShfnYxs6GggUhLRlGtrQ0E,156
@@ -13,7 +13,7 @@ pre_commit_hooks/run_bump_my_version/__init__.py,sha256=OsMY0boz3VTqAtgLCHtC8AvC
13
13
  pre_commit_hooks/run_bump_my_version/__main__.py,sha256=w2V3y61jrSau-zxjl8ciHtWPlJQwXbYxNJ2tGYVyI4s,156
14
14
  pre_commit_hooks/tag_commits/__init__.py,sha256=097p0gfZcykpOPUgGYsrLePe8Nar04eKlCMn_mqPepg,2945
15
15
  pre_commit_hooks/tag_commits/__main__.py,sha256=qefgYw7LWbvmzZS45-ym6olS4cHqw1Emw2wlqZBXN_o,148
16
- dycw_pre_commit_hooks-0.12.8.dist-info/METADATA,sha256=SPMmd6uxKS3rmwv3zR0RGgv44Py_NYMGWom8R7kIlcI,1105
17
- dycw_pre_commit_hooks-0.12.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
18
- dycw_pre_commit_hooks-0.12.8.dist-info/entry_points.txt,sha256=0xGzim6HTjeOXJpusYjBk0aEYkXQR2IwrmfzM6KT_r0,368
19
- dycw_pre_commit_hooks-0.12.8.dist-info/RECORD,,
16
+ dycw_pre_commit_hooks-0.12.9.dist-info/METADATA,sha256=4FTUextZ5Ocnpgfdr1papnRJS4QvgpP6lOeg-TSpeEY,1105
17
+ dycw_pre_commit_hooks-0.12.9.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
18
+ dycw_pre_commit_hooks-0.12.9.dist-info/entry_points.txt,sha256=0xGzim6HTjeOXJpusYjBk0aEYkXQR2IwrmfzM6KT_r0,368
19
+ dycw_pre_commit_hooks-0.12.9.dist-info/RECORD,,
@@ -1,3 +1,3 @@
1
1
  from __future__ import annotations
2
2
 
3
- __version__ = "0.12.8"
3
+ __version__ = "0.12.9"
@@ -2,7 +2,8 @@ from __future__ import annotations
2
2
 
3
3
  from typing import TYPE_CHECKING
4
4
 
5
- from click import command
5
+ import utilities.click
6
+ from click import argument, command
6
7
  from git import Repo, Submodule
7
8
 
8
9
  from pre_commit_hooks.common import (
@@ -16,18 +17,24 @@ from pre_commit_hooks.common import (
16
17
  )
17
18
 
18
19
  if TYPE_CHECKING:
20
+ from pathlib import Path
21
+
19
22
  from whenever import DateTimeDelta
20
23
 
21
24
 
22
25
  @command()
26
+ @argument("paths", nargs=-1, type=utilities.click.Path())
23
27
  @run_every_option
24
- def main(*, run_every: DateTimeDelta | None = None) -> bool:
28
+ def main(*, paths: tuple[Path, ...], run_every: DateTimeDelta | None = None) -> bool:
25
29
  """CLI for the `check-submodules` hook."""
26
- return throttled_run("check-submodules", run_every, _process)
30
+ results = [
31
+ throttled_run("check-submodules", run_every, _process, p) for p in paths
32
+ ] # run all
33
+ return all(results)
27
34
 
28
35
 
29
- def _process() -> bool:
30
- repo = Repo(".", search_parent_directories=True)
36
+ def _process(path: Path, /) -> bool:
37
+ repo = Repo(path, search_parent_directories=True)
31
38
  results = [_process_submodule(s) for s in repo.submodules] # run all
32
39
  return all(results)
33
40