crackerjack 0.26.0__py3-none-any.whl → 0.27.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 crackerjack might be problematic. Click here for more details.
- crackerjack/.gitignore +11 -0
- crackerjack/.pre-commit-config-ai.yaml +54 -34
- crackerjack/.pre-commit-config.yaml +23 -4
- crackerjack/__main__.py +22 -1
- crackerjack/crackerjack.py +1360 -39
- crackerjack/pyproject.toml +68 -30
- {crackerjack-0.26.0.dist-info → crackerjack-0.27.0.dist-info}/METADATA +2 -1
- crackerjack-0.27.0.dist-info/RECORD +16 -0
- crackerjack-0.26.0.dist-info/RECORD +0 -16
- {crackerjack-0.26.0.dist-info → crackerjack-0.27.0.dist-info}/WHEEL +0 -0
- {crackerjack-0.26.0.dist-info → crackerjack-0.27.0.dist-info}/licenses/LICENSE +0 -0
crackerjack/.gitignore
CHANGED
|
@@ -18,3 +18,14 @@
|
|
|
18
18
|
/coverage.json
|
|
19
19
|
/test-results.xml
|
|
20
20
|
/.coverage
|
|
21
|
+
|
|
22
|
+
# AI agent output files
|
|
23
|
+
/hooks-analysis.json
|
|
24
|
+
/quality-metrics.json
|
|
25
|
+
/project-structure.json
|
|
26
|
+
/error-context.json
|
|
27
|
+
/ai-agent-summary.json
|
|
28
|
+
/bandit-report.json
|
|
29
|
+
|
|
30
|
+
# Autotyping cache
|
|
31
|
+
.autotyping-cache/
|
|
@@ -1,105 +1,112 @@
|
|
|
1
|
+
# AI-optimized pre-commit hooks for comprehensive analysis and structured output
|
|
2
|
+
# Designed for AI agent workflows with enhanced reporting and metrics
|
|
3
|
+
|
|
1
4
|
repos:
|
|
2
|
-
# File
|
|
5
|
+
# Group 1: File Structure & Format Validation (parallel-safe, fast)
|
|
3
6
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
4
7
|
rev: v5.0.0
|
|
5
8
|
hooks:
|
|
6
9
|
- id: trailing-whitespace
|
|
7
10
|
name: trailing-whitespace
|
|
8
|
-
|
|
11
|
+
stages: [pre-commit]
|
|
9
12
|
- id: end-of-file-fixer
|
|
10
13
|
name: end-of-file-fixer
|
|
11
|
-
|
|
14
|
+
stages: [pre-commit]
|
|
12
15
|
- id: check-yaml
|
|
13
16
|
name: check-yaml
|
|
14
|
-
|
|
17
|
+
stages: [pre-commit]
|
|
15
18
|
- id: check-toml
|
|
16
19
|
name: check-toml
|
|
17
|
-
|
|
20
|
+
stages: [pre-commit]
|
|
18
21
|
- id: check-added-large-files
|
|
19
22
|
name: check-added-large-files
|
|
20
|
-
|
|
23
|
+
stages: [pre-commit]
|
|
21
24
|
|
|
25
|
+
# Group 2: Project Configuration Management
|
|
22
26
|
- repo: https://github.com/abravalheri/validate-pyproject
|
|
23
27
|
rev: v0.24.1
|
|
24
28
|
hooks:
|
|
25
29
|
- id: validate-pyproject
|
|
26
|
-
|
|
30
|
+
stages: [pre-commit]
|
|
27
31
|
|
|
28
32
|
- repo: https://github.com/tox-dev/pyproject-fmt
|
|
29
33
|
rev: "v2.6.0"
|
|
30
34
|
hooks:
|
|
31
35
|
- id: pyproject-fmt
|
|
32
36
|
args: ["-n"]
|
|
33
|
-
|
|
37
|
+
stages: [pre-commit]
|
|
34
38
|
|
|
35
|
-
# Package management - once structure is valid
|
|
36
39
|
- repo: https://github.com/astral-sh/uv-pre-commit
|
|
37
|
-
rev: 0.7.
|
|
40
|
+
rev: 0.7.21
|
|
38
41
|
hooks:
|
|
39
42
|
- id: uv-lock
|
|
40
43
|
files: ^pyproject\.toml$
|
|
41
|
-
|
|
44
|
+
stages: [pre-commit]
|
|
42
45
|
|
|
43
|
-
#
|
|
46
|
+
# Group 3: Security (early detection, critical)
|
|
44
47
|
- repo: https://github.com/Yelp/detect-secrets
|
|
45
48
|
rev: v1.5.0
|
|
46
49
|
hooks:
|
|
47
50
|
- id: detect-secrets
|
|
48
51
|
exclude: 'uv\.lock|pyproject\.toml|tests/.*|docs/.*|.*\.md'
|
|
49
|
-
|
|
52
|
+
stages: [pre-commit]
|
|
50
53
|
|
|
51
|
-
# Code
|
|
54
|
+
# Group 4: Code Quality & Style (fast formatting)
|
|
52
55
|
- repo: https://github.com/codespell-project/codespell
|
|
53
56
|
rev: v2.4.1
|
|
54
57
|
hooks:
|
|
55
58
|
- id: codespell
|
|
56
|
-
verbose: true
|
|
57
59
|
additional_dependencies:
|
|
58
60
|
- tomli
|
|
61
|
+
stages: [pre-commit]
|
|
59
62
|
|
|
60
63
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
61
|
-
rev: v0.12.
|
|
64
|
+
rev: v0.12.3
|
|
62
65
|
hooks:
|
|
63
66
|
- id: ruff-check
|
|
64
|
-
|
|
65
|
-
|
|
67
|
+
args: ["--output-format=json", "--fix"]
|
|
68
|
+
stages: [pre-commit]
|
|
66
69
|
- id: ruff-format
|
|
67
|
-
|
|
70
|
+
stages: [pre-commit]
|
|
68
71
|
|
|
69
72
|
- repo: https://github.com/executablebooks/mdformat
|
|
70
|
-
rev: 0.7.
|
|
73
|
+
rev: 0.7.22
|
|
71
74
|
hooks:
|
|
72
75
|
- id: mdformat
|
|
73
76
|
additional_dependencies:
|
|
74
77
|
- mdformat-ruff
|
|
78
|
+
stages: [pre-commit]
|
|
75
79
|
|
|
76
|
-
#
|
|
80
|
+
# Group 5: Static Analysis (comprehensive, slower)
|
|
77
81
|
- repo: https://github.com/jendrikseipp/vulture
|
|
78
82
|
rev: 'v2.14'
|
|
79
83
|
hooks:
|
|
80
84
|
- id: vulture
|
|
81
|
-
|
|
85
|
+
args: ["--verbose"]
|
|
86
|
+
stages: [pre-commit]
|
|
82
87
|
|
|
83
88
|
- repo: https://github.com/fredrikaverpil/creosote
|
|
84
89
|
rev: v4.0.3
|
|
85
90
|
hooks:
|
|
86
91
|
- id: creosote
|
|
87
|
-
|
|
92
|
+
args: ["--verbose"]
|
|
93
|
+
stages: [pre-commit]
|
|
88
94
|
|
|
89
95
|
- repo: https://github.com/rohaquinlop/complexipy-pre-commit
|
|
90
96
|
rev: v3.0.0
|
|
91
97
|
hooks:
|
|
92
98
|
- id: complexipy
|
|
93
|
-
args: ["-d", "low", "
|
|
94
|
-
|
|
99
|
+
args: ["-d", "low", "--output", "complexipy.json"]
|
|
100
|
+
stages: [pre-commit]
|
|
95
101
|
|
|
96
102
|
- repo: https://github.com/dosisod/refurb
|
|
97
103
|
rev: v2.1.0
|
|
98
104
|
hooks:
|
|
99
105
|
- id: refurb
|
|
100
|
-
|
|
106
|
+
args: ["--quiet"]
|
|
107
|
+
stages: [pre-commit]
|
|
101
108
|
|
|
102
|
-
#
|
|
109
|
+
# Group 6: Type Checking & Enhancement (most expensive)
|
|
103
110
|
- repo: local
|
|
104
111
|
hooks:
|
|
105
112
|
- id: autotyping
|
|
@@ -109,25 +116,38 @@ repos:
|
|
|
109
116
|
- --aggressive
|
|
110
117
|
- --only-without-imports
|
|
111
118
|
- --guess-common-names
|
|
119
|
+
- --cache-dir=.autotyping-cache
|
|
120
|
+
- --workers=4
|
|
121
|
+
- --max-line-length=88
|
|
122
|
+
- --exclude-name=test_*,conftest
|
|
112
123
|
- crackerjack
|
|
113
124
|
types_or: [ python, pyi ]
|
|
114
125
|
language: python
|
|
115
|
-
files:
|
|
116
|
-
|
|
126
|
+
files: ^crackerjack/.*\.py$
|
|
127
|
+
stages: [pre-commit]
|
|
117
128
|
additional_dependencies:
|
|
118
129
|
- autotyping>=24.3.0
|
|
119
130
|
- libcst>=1.1.0
|
|
120
131
|
|
|
121
132
|
- repo: https://github.com/PyCQA/bandit
|
|
122
|
-
rev: '1.8.
|
|
133
|
+
rev: '1.8.6'
|
|
123
134
|
hooks:
|
|
124
135
|
- id: bandit
|
|
125
|
-
args: ["-c", "pyproject.toml", "
|
|
126
|
-
|
|
136
|
+
args: ["-c", "pyproject.toml", "-f", "json", "-o", "bandit-report.json", "-r", "-ll"]
|
|
137
|
+
stages: [pre-commit]
|
|
127
138
|
|
|
128
139
|
- repo: https://github.com/RobertCraigie/pyright-python
|
|
129
|
-
rev: v1.1.
|
|
140
|
+
rev: v1.1.403
|
|
130
141
|
hooks:
|
|
131
142
|
- id: pyright
|
|
132
|
-
verbose: true
|
|
133
143
|
args: ["--outputjson"]
|
|
144
|
+
stages: [pre-commit]
|
|
145
|
+
|
|
146
|
+
# Group 7: Documentation & Security Enhancement (AI-specific)
|
|
147
|
+
# pydocstyle temporarily disabled - conflicts with code cleaning functionality
|
|
148
|
+
# - repo: https://github.com/PyCQA/pydocstyle
|
|
149
|
+
# rev: 6.3.0
|
|
150
|
+
# hooks:
|
|
151
|
+
# - id: pydocstyle
|
|
152
|
+
# args: ["--config=pyproject.toml"]
|
|
153
|
+
# stages: [pre-commit]
|
|
@@ -55,29 +55,33 @@ repos:
|
|
|
55
55
|
additional_dependencies:
|
|
56
56
|
- mdformat-ruff
|
|
57
57
|
|
|
58
|
-
# Code quality tier 2 - analysis
|
|
58
|
+
# Code quality tier 2 - analysis (moved to pre-push for performance)
|
|
59
59
|
- repo: https://github.com/jendrikseipp/vulture
|
|
60
60
|
rev: 'v2.14'
|
|
61
61
|
hooks:
|
|
62
62
|
- id: vulture
|
|
63
|
+
stages: [pre-push, manual]
|
|
63
64
|
|
|
64
65
|
- repo: https://github.com/fredrikaverpil/creosote
|
|
65
66
|
rev: v4.0.3
|
|
66
67
|
hooks:
|
|
67
68
|
- id: creosote
|
|
69
|
+
stages: [pre-push, manual]
|
|
68
70
|
|
|
69
71
|
- repo: https://github.com/rohaquinlop/complexipy-pre-commit
|
|
70
72
|
rev: v3.0.0
|
|
71
73
|
hooks:
|
|
72
74
|
- id: complexipy
|
|
73
75
|
args: ["-d", "low"]
|
|
76
|
+
stages: [pre-push, manual]
|
|
74
77
|
|
|
75
78
|
- repo: https://github.com/dosisod/refurb
|
|
76
79
|
rev: v2.1.0
|
|
77
80
|
hooks:
|
|
78
81
|
- id: refurb
|
|
82
|
+
stages: [pre-push, manual]
|
|
79
83
|
|
|
80
|
-
# Code quality tier 3 - thorough checks
|
|
84
|
+
# Code quality tier 3 - thorough checks (moved to pre-push for performance)
|
|
81
85
|
- repo: local
|
|
82
86
|
hooks:
|
|
83
87
|
- id: autotyping
|
|
@@ -87,10 +91,15 @@ repos:
|
|
|
87
91
|
- --aggressive
|
|
88
92
|
- --only-without-imports
|
|
89
93
|
- --guess-common-names
|
|
94
|
+
- --cache-dir=.autotyping-cache
|
|
95
|
+
- --workers=4
|
|
96
|
+
- --max-line-length=88
|
|
97
|
+
- --exclude-name=test_*,conftest
|
|
90
98
|
- crackerjack
|
|
91
99
|
types_or: [ python, pyi ]
|
|
92
100
|
language: python
|
|
93
|
-
files:
|
|
101
|
+
files: ^crackerjack/.*\.py$
|
|
102
|
+
stages: [pre-push, manual]
|
|
94
103
|
additional_dependencies:
|
|
95
104
|
- autotyping>=24.3.0
|
|
96
105
|
- libcst>=1.1.0
|
|
@@ -99,9 +108,19 @@ repos:
|
|
|
99
108
|
rev: '1.8.6'
|
|
100
109
|
hooks:
|
|
101
110
|
- id: bandit
|
|
102
|
-
args: ["-c", "pyproject.toml"]
|
|
111
|
+
args: ["-c", "pyproject.toml", "-r", "-ll"]
|
|
112
|
+
stages: [pre-push, manual]
|
|
103
113
|
|
|
104
114
|
- repo: https://github.com/RobertCraigie/pyright-python
|
|
105
115
|
rev: v1.1.403
|
|
106
116
|
hooks:
|
|
107
117
|
- id: pyright
|
|
118
|
+
stages: [pre-push, manual]
|
|
119
|
+
|
|
120
|
+
# Additional quality and security checks
|
|
121
|
+
- repo: https://github.com/PyCQA/pydocstyle
|
|
122
|
+
rev: 6.3.0
|
|
123
|
+
hooks:
|
|
124
|
+
- id: pydocstyle
|
|
125
|
+
args: ["--config=pyproject.toml"]
|
|
126
|
+
stages: [pre-push, manual]
|
crackerjack/__main__.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import asyncio
|
|
1
2
|
from enum import Enum
|
|
2
3
|
|
|
3
4
|
import typer
|
|
@@ -39,6 +40,8 @@ class Options(BaseModel):
|
|
|
39
40
|
ai_agent: bool = False
|
|
40
41
|
create_pr: bool = False
|
|
41
42
|
skip_hooks: bool = False
|
|
43
|
+
comprehensive: bool = False
|
|
44
|
+
async_mode: bool = False
|
|
42
45
|
|
|
43
46
|
@classmethod
|
|
44
47
|
@field_validator("publish", "bump", mode="before")
|
|
@@ -137,6 +140,17 @@ cli_options = {
|
|
|
137
140
|
help="Enable AI agent mode with structured output.",
|
|
138
141
|
hidden=True,
|
|
139
142
|
),
|
|
143
|
+
"comprehensive": typer.Option(
|
|
144
|
+
False,
|
|
145
|
+
"--comprehensive",
|
|
146
|
+
help="Use comprehensive pre-commit hooks (slower but thorough).",
|
|
147
|
+
),
|
|
148
|
+
"async_mode": typer.Option(
|
|
149
|
+
False,
|
|
150
|
+
"--async",
|
|
151
|
+
help="Enable async mode for faster file operations (experimental).",
|
|
152
|
+
hidden=True,
|
|
153
|
+
),
|
|
140
154
|
}
|
|
141
155
|
|
|
142
156
|
|
|
@@ -162,6 +176,8 @@ def main(
|
|
|
162
176
|
skip_hooks: bool = cli_options["skip_hooks"],
|
|
163
177
|
create_pr: bool = cli_options["create_pr"],
|
|
164
178
|
ai_agent: bool = cli_options["ai_agent"],
|
|
179
|
+
comprehensive: bool = cli_options["comprehensive"],
|
|
180
|
+
async_mode: bool = cli_options["async_mode"],
|
|
165
181
|
) -> None:
|
|
166
182
|
options = Options(
|
|
167
183
|
commit=commit,
|
|
@@ -181,7 +197,9 @@ def main(
|
|
|
181
197
|
skip_hooks=skip_hooks,
|
|
182
198
|
all=all,
|
|
183
199
|
ai_agent=ai_agent,
|
|
200
|
+
comprehensive=comprehensive,
|
|
184
201
|
create_pr=create_pr,
|
|
202
|
+
async_mode=async_mode,
|
|
185
203
|
)
|
|
186
204
|
if ai_agent:
|
|
187
205
|
import os
|
|
@@ -199,7 +217,10 @@ def main(
|
|
|
199
217
|
launch_interactive_cli(pkg_version)
|
|
200
218
|
else:
|
|
201
219
|
runner = create_crackerjack_runner(console=console)
|
|
202
|
-
|
|
220
|
+
if async_mode:
|
|
221
|
+
asyncio.run(runner.process_async(options))
|
|
222
|
+
else:
|
|
223
|
+
runner.process(options)
|
|
203
224
|
|
|
204
225
|
|
|
205
226
|
if __name__ == "__main__":
|