crackerjack 0.21.1__py3-none-any.whl → 0.21.3__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.
- crackerjack/.pre-commit-config-ai.yaml +135 -0
- crackerjack/.ruff_cache/0.12.1/5056746222905752453 +0 -0
- crackerjack/crackerjack.py +22 -6
- crackerjack/pyproject.toml +1 -1
- {crackerjack-0.21.1.dist-info → crackerjack-0.21.3.dist-info}/METADATA +1 -1
- {crackerjack-0.21.1.dist-info → crackerjack-0.21.3.dist-info}/RECORD +9 -8
- {crackerjack-0.21.1.dist-info → crackerjack-0.21.3.dist-info}/WHEEL +0 -0
- {crackerjack-0.21.1.dist-info → crackerjack-0.21.3.dist-info}/entry_points.txt +0 -0
- {crackerjack-0.21.1.dist-info → crackerjack-0.21.3.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,135 @@
|
|
1
|
+
repos:
|
2
|
+
# File structure and format validators - check structure first
|
3
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
4
|
+
rev: v5.0.0
|
5
|
+
hooks:
|
6
|
+
- id: trailing-whitespace
|
7
|
+
name: trailing-whitespace
|
8
|
+
verbose: true
|
9
|
+
- id: end-of-file-fixer
|
10
|
+
name: end-of-file-fixer
|
11
|
+
verbose: true
|
12
|
+
- id: check-yaml
|
13
|
+
name: check-yaml
|
14
|
+
verbose: true
|
15
|
+
- id: check-toml
|
16
|
+
name: check-toml
|
17
|
+
verbose: true
|
18
|
+
- id: check-added-large-files
|
19
|
+
name: check-added-large-files
|
20
|
+
verbose: true
|
21
|
+
|
22
|
+
- repo: https://github.com/abravalheri/validate-pyproject
|
23
|
+
rev: v0.24.1
|
24
|
+
hooks:
|
25
|
+
- id: validate-pyproject
|
26
|
+
verbose: true
|
27
|
+
|
28
|
+
- repo: https://github.com/tox-dev/pyproject-fmt
|
29
|
+
rev: "v2.6.0"
|
30
|
+
hooks:
|
31
|
+
- id: pyproject-fmt
|
32
|
+
verbose: true
|
33
|
+
|
34
|
+
# Package management - once structure is valid
|
35
|
+
- repo: https://github.com/pdm-project/pdm
|
36
|
+
rev: 2.25.3
|
37
|
+
hooks:
|
38
|
+
- id: pdm-lock-check
|
39
|
+
verbose: true
|
40
|
+
- id: pdm-sync
|
41
|
+
verbose: true
|
42
|
+
additional_dependencies:
|
43
|
+
- keyring
|
44
|
+
|
45
|
+
- repo: https://github.com/astral-sh/uv-pre-commit
|
46
|
+
rev: 0.7.15
|
47
|
+
hooks:
|
48
|
+
- id: uv-lock
|
49
|
+
files: ^pyproject\.toml$
|
50
|
+
verbose: true
|
51
|
+
|
52
|
+
# Security check - early to prevent credential leaks
|
53
|
+
- repo: https://github.com/Yelp/detect-secrets
|
54
|
+
rev: v1.5.0
|
55
|
+
hooks:
|
56
|
+
- id: detect-secrets
|
57
|
+
exclude: 'pdm\.lock|uv\.lock|pyproject\.toml|tests/.*|docs/.*|.*\.md'
|
58
|
+
verbose: true
|
59
|
+
|
60
|
+
# Code quality tier 1 - quick fixes
|
61
|
+
- repo: https://github.com/codespell-project/codespell
|
62
|
+
rev: v2.4.1
|
63
|
+
hooks:
|
64
|
+
- id: codespell
|
65
|
+
verbose: true
|
66
|
+
additional_dependencies:
|
67
|
+
- tomli
|
68
|
+
|
69
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
70
|
+
rev: v0.12.1
|
71
|
+
hooks:
|
72
|
+
- id: ruff-check
|
73
|
+
verbose: true
|
74
|
+
args: [--output-format=json]
|
75
|
+
- id: ruff-format
|
76
|
+
verbose: true
|
77
|
+
|
78
|
+
# Code quality tier 2 - analysis
|
79
|
+
- repo: https://github.com/jendrikseipp/vulture
|
80
|
+
rev: 'v2.14'
|
81
|
+
hooks:
|
82
|
+
- id: vulture
|
83
|
+
verbose: true
|
84
|
+
|
85
|
+
- repo: https://github.com/fredrikaverpil/creosote
|
86
|
+
rev: v4.0.3
|
87
|
+
hooks:
|
88
|
+
- id: creosote
|
89
|
+
verbose: true
|
90
|
+
|
91
|
+
- repo: https://github.com/rohaquinlop/complexipy-pre-commit
|
92
|
+
rev: v3.0.0
|
93
|
+
hooks:
|
94
|
+
- id: complexipy
|
95
|
+
args: ["-d", "low", "-j"]
|
96
|
+
verbose: true
|
97
|
+
|
98
|
+
- repo: https://github.com/dosisod/refurb
|
99
|
+
rev: v2.1.0
|
100
|
+
hooks:
|
101
|
+
- id: refurb
|
102
|
+
verbose: true
|
103
|
+
|
104
|
+
# Code quality tier 3 - thorough checks
|
105
|
+
- repo: local
|
106
|
+
hooks:
|
107
|
+
- id: autotyping
|
108
|
+
name: autotyping
|
109
|
+
entry: python -m autotyping
|
110
|
+
args:
|
111
|
+
- --aggressive
|
112
|
+
- --only-without-imports
|
113
|
+
- --guess-common-names
|
114
|
+
- crackerjack
|
115
|
+
types_or: [ python, pyi ]
|
116
|
+
language: python
|
117
|
+
files: \.py$
|
118
|
+
verbose: true
|
119
|
+
additional_dependencies:
|
120
|
+
- autotyping>=24.3.0
|
121
|
+
- libcst>=1.1.0
|
122
|
+
|
123
|
+
- repo: https://github.com/PyCQA/bandit
|
124
|
+
rev: '1.8.5'
|
125
|
+
hooks:
|
126
|
+
- id: bandit
|
127
|
+
args: ["-c", "pyproject.toml", "--format", "json"]
|
128
|
+
verbose: true
|
129
|
+
|
130
|
+
- repo: https://github.com/RobertCraigie/pyright-python
|
131
|
+
rev: v1.1.402
|
132
|
+
hooks:
|
133
|
+
- id: pyright
|
134
|
+
verbose: true
|
135
|
+
args: ["--outputjson"]
|
Binary file
|
crackerjack/crackerjack.py
CHANGED
@@ -12,7 +12,12 @@ from rich.console import Console
|
|
12
12
|
from tomli_w import dumps
|
13
13
|
from crackerjack.errors import ErrorCode, ExecutionError
|
14
14
|
|
15
|
-
config_files = (
|
15
|
+
config_files = (
|
16
|
+
".gitignore",
|
17
|
+
".pre-commit-config.yaml",
|
18
|
+
".pre-commit-config-ai.yaml",
|
19
|
+
".libcst.codemod.yaml",
|
20
|
+
)
|
16
21
|
default_python_version = "3.13"
|
17
22
|
|
18
23
|
|
@@ -534,6 +539,7 @@ class ProjectManager(BaseModel, arbitrary_types_allowed=True):
|
|
534
539
|
code_cleaner: CodeCleaner
|
535
540
|
config_manager: ConfigManager
|
536
541
|
dry_run: bool = False
|
542
|
+
options: t.Any = None
|
537
543
|
|
538
544
|
def update_pkg_configs(self) -> None:
|
539
545
|
self.config_manager.copy_configs()
|
@@ -548,15 +554,21 @@ class ProjectManager(BaseModel, arbitrary_types_allowed=True):
|
|
548
554
|
self.execute_command(["git", "branch", "-m", "main"])
|
549
555
|
self.execute_command(["git", "add", "pyproject.toml"])
|
550
556
|
self.execute_command(["git", "add", "pdm.lock"])
|
551
|
-
|
557
|
+
install_cmd = ["pre-commit", "install"]
|
558
|
+
if hasattr(self, "options") and getattr(self.options, "ai_agent", False):
|
559
|
+
install_cmd.extend(["-c", ".pre-commit-config-ai.yaml"])
|
560
|
+
self.execute_command(install_cmd)
|
552
561
|
self.execute_command(["git", "config", "advice.addIgnoredFile", "false"])
|
553
562
|
self.config_manager.update_pyproject_configs()
|
554
563
|
|
555
564
|
def run_pre_commit(self) -> None:
|
556
565
|
self.console.print("\nRunning pre-commit hooks...\n")
|
557
|
-
|
566
|
+
cmd = ["pre-commit", "run", "--all-files"]
|
567
|
+
if hasattr(self, "options") and getattr(self.options, "ai_agent", False):
|
568
|
+
cmd.extend(["-c", ".pre-commit-config-ai.yaml"])
|
569
|
+
check_all = self.execute_command(cmd)
|
558
570
|
if check_all.returncode > 0:
|
559
|
-
check_all = self.execute_command(
|
571
|
+
check_all = self.execute_command(cmd)
|
560
572
|
if check_all.returncode > 0:
|
561
573
|
self.console.print("\n\nPre-commit failed. Please fix errors.\n")
|
562
574
|
raise SystemExit(1)
|
@@ -621,7 +633,7 @@ class Crackerjack(BaseModel, arbitrary_types_allowed=True):
|
|
621
633
|
)
|
622
634
|
if result.returncode == 0:
|
623
635
|
self.console.print("PDM installed: ✅\n")
|
624
|
-
self.execute_command(["pdm", "
|
636
|
+
self.execute_command(["pdm", "sync"])
|
625
637
|
self.console.print("Lock file updated: ✅\n")
|
626
638
|
else:
|
627
639
|
self.console.print(
|
@@ -630,7 +642,10 @@ class Crackerjack(BaseModel, arbitrary_types_allowed=True):
|
|
630
642
|
|
631
643
|
def _update_precommit(self, options: t.Any) -> None:
|
632
644
|
if self.pkg_path.stem == "crackerjack" and options.update_precommit:
|
633
|
-
|
645
|
+
update_cmd = ["pre-commit", "autoupdate"]
|
646
|
+
if options.ai_agent:
|
647
|
+
update_cmd.extend(["-c", ".pre-commit-config-ai.yaml"])
|
648
|
+
self.execute_command(update_cmd)
|
634
649
|
|
635
650
|
def _clean_project(self, options: t.Any) -> None:
|
636
651
|
if options.clean:
|
@@ -774,6 +789,7 @@ class Crackerjack(BaseModel, arbitrary_types_allowed=True):
|
|
774
789
|
self._update_project(options)
|
775
790
|
self._update_precommit(options)
|
776
791
|
self._clean_project(options)
|
792
|
+
self.project_manager.options = options
|
777
793
|
if not options.skip_hooks:
|
778
794
|
self.project_manager.run_pre_commit()
|
779
795
|
else:
|
crackerjack/pyproject.toml
CHANGED
@@ -1,10 +1,11 @@
|
|
1
|
-
crackerjack-0.21.
|
2
|
-
crackerjack-0.21.
|
3
|
-
crackerjack-0.21.
|
4
|
-
crackerjack-0.21.
|
1
|
+
crackerjack-0.21.3.dist-info/METADATA,sha256=3rMVMxzQB-h8hfmD4C65zFZ3hpWiYCetZE4O7iMtePA,26414
|
2
|
+
crackerjack-0.21.3.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
|
3
|
+
crackerjack-0.21.3.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
|
4
|
+
crackerjack-0.21.3.dist-info/licenses/LICENSE,sha256=fDt371P6_6sCu7RyqiZH_AhT1LdN3sN1zjBtqEhDYCk,1531
|
5
5
|
crackerjack/.gitignore,sha256=FOLrDV-tuHpwof310aOi6cWOkJXeVI_gvWvg_paDzs4,199
|
6
6
|
crackerjack/.libcst.codemod.yaml,sha256=a8DlErRAIPV1nE6QlyXPAzTOgkB24_spl2E9hphuf5s,772
|
7
7
|
crackerjack/.pdm.toml,sha256=dZe44HRcuxxCFESGG8SZIjmc-cGzSoyK3Hs6t4NYA8w,23
|
8
|
+
crackerjack/.pre-commit-config-ai.yaml,sha256=K8xXKMJcdhfXOk24L4XpK7H8YlvnZfOh4NVA6qvOz8I,3319
|
8
9
|
crackerjack/.pre-commit-config.yaml,sha256=glBcQ4nwC28t4Ier2E69bUg8pNQ9YyCtHmD-fV6bRm0,3076
|
9
10
|
crackerjack/.pytest_cache/.gitignore,sha256=Ptcxtl0GFQwTji2tsL4Gl1UIiKa0frjEXsya26i46b0,37
|
10
11
|
crackerjack/.pytest_cache/CACHEDIR.TAG,sha256=N9yI75oKvt2-gQU6bdj9-xOvthMEXqHrSlyBWnSjveQ,191
|
@@ -33,7 +34,7 @@ crackerjack/.ruff_cache/0.11.7/10386934055395314831,sha256=lBNwN5zAgM4OzbkXIOzCc
|
|
33
34
|
crackerjack/.ruff_cache/0.11.7/3557596832929915217,sha256=fKlwUbsvT3YIKV6UR-aA_i64lLignWeVfVu-MMmVbU0,207
|
34
35
|
crackerjack/.ruff_cache/0.11.8/530407680854991027,sha256=xAMAL3Vu_HR6M-h5ojCTaak0By5ii8u-14pXULLgLqw,224
|
35
36
|
crackerjack/.ruff_cache/0.12.0/5056746222905752453,sha256=MqrIT5qymJcgAOBZyn-TvYoGCFfDFCgN9IwSULq8n14,256
|
36
|
-
crackerjack/.ruff_cache/0.12.1/5056746222905752453,sha256=
|
37
|
+
crackerjack/.ruff_cache/0.12.1/5056746222905752453,sha256=Vt5lYVKfx8KnImTaENVD9RcVqNrAePVU4Q_bPTcUCWk,256
|
37
38
|
crackerjack/.ruff_cache/0.2.0/10047773857155985907,sha256=j9LNa_RQ4Plor7go1uTYgz17cEENKvZQ-dP6b9MX0ik,248
|
38
39
|
crackerjack/.ruff_cache/0.2.1/8522267973936635051,sha256=u_aPBMibtAp_iYvLwR88GMAECMcIgHezxMyuapmU2P4,248
|
39
40
|
crackerjack/.ruff_cache/0.2.2/18053836298936336950,sha256=Xb_ebP0pVuUfSqPEZKlhQ70so_vqkEfMYpuHQ06iR5U,248
|
@@ -63,9 +64,9 @@ crackerjack/.ruff_cache/0.9.9/8843823720003377982,sha256=e4ymkXfQsUg5e_mtO34xTsa
|
|
63
64
|
crackerjack/.ruff_cache/CACHEDIR.TAG,sha256=WVMVbX4MVkpCclExbq8m-IcOZIOuIZf5FrYw5Pk-Ma4,43
|
64
65
|
crackerjack/__init__.py,sha256=8tBSPAru_YDuPpjz05cL7pNbZjYFoRT_agGd_FWa3gY,839
|
65
66
|
crackerjack/__main__.py,sha256=AknITUlFjq3YUK9s2xeL62dM0GN82JBQyDkPzQ_hCUg,6561
|
66
|
-
crackerjack/crackerjack.py,sha256=
|
67
|
+
crackerjack/crackerjack.py,sha256=DmFL6b-THnHjoPtkx6U7HGnNOhkNc_Vdj3nEXKiS9t0,31437
|
67
68
|
crackerjack/errors.py,sha256=QEPtVuMtKtQHuawgr1ToMaN1KbUg5h9-4mS33YB5Znk,4062
|
68
69
|
crackerjack/interactive.py,sha256=5KXKSvWKttLvHcI1L4VEDc3Rb-ZpHBOl_Qr7lhD-O4Q,16262
|
69
70
|
crackerjack/py313.py,sha256=buYE7LO11Q64ffowEhTZRFQoAGj_8sg3DTlZuv8M9eo,5890
|
70
|
-
crackerjack/pyproject.toml,sha256=
|
71
|
-
crackerjack-0.21.
|
71
|
+
crackerjack/pyproject.toml,sha256=d3_0SykMuX5We-tODg2ARKxrFOnQm46wsiso_H0dMaE,4988
|
72
|
+
crackerjack-0.21.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|