crackerjack 0.22.2__tar.gz → 0.22.4__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.
Potentially problematic release.
This version of crackerjack might be problematic. Click here for more details.
- {crackerjack-0.22.2 → crackerjack-0.22.4}/PKG-INFO +4 -4
- crackerjack-0.22.4/crackerjack/.ruff_cache/0.12.1/5056746222905752453 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/crackerjack.py +76 -28
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/pyproject.toml +4 -4
- {crackerjack-0.22.2 → crackerjack-0.22.4}/pyproject.toml +4 -4
- {crackerjack-0.22.2 → crackerjack-0.22.4}/tests/test_crackerjack.py +9 -3
- crackerjack-0.22.2/crackerjack/.ruff_cache/0.12.1/5056746222905752453 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/LICENSE +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/README.md +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.gitignore +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.libcst.codemod.yaml +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.pdm.toml +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.pre-commit-config-ai.yaml +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.pre-commit-config.yaml +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.pytest_cache/.gitignore +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.pytest_cache/CACHEDIR.TAG +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.pytest_cache/README.md +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.pytest_cache/v/cache/nodeids +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.pytest_cache/v/cache/stepwise +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/.gitignore +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.1.11/3256171999636029978 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.1.14/602324811142551221 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.1.4/10355199064880463147 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.1.6/15140459877605758699 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.1.7/1790508110482614856 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.1.9/17041001205004563469 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.11.11/18187162184424859798 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.11.12/16869036553936192448 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.11.12/1867267426380906393 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.11.12/4240757255861806333 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.11.12/4441409093023629623 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.11.13/1867267426380906393 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.11.13/4240757255861806333 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.11.2/4070660268492669020 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.11.3/9818742842212983150 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.11.4/9818742842212983150 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.11.6/3557596832929915217 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.11.7/10386934055395314831 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.11.7/3557596832929915217 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.11.8/530407680854991027 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.12.0/5056746222905752453 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.2.0/10047773857155985907 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.2.1/8522267973936635051 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.2.2/18053836298936336950 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.3.0/12548816621480535786 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.3.3/11081883392474770722 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.3.4/676973378459347183 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.3.5/16311176246009842383 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.5.7/1493622539551733492 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.5.7/6231957614044513175 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.5.7/9932762556785938009 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.6.0/11982804814124138945 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.6.0/12055761203849489982 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.6.2/1206147804896221174 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.6.4/1206147804896221174 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.6.5/1206147804896221174 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.6.7/3657366982708166874 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.6.9/285614542852677309 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.7.1/1024065805990144819 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.7.1/285614542852677309 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.7.3/16061516852537040135 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.8.4/16354268377385700367 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.9.10/12813592349865671909 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.9.10/923908772239632759 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.9.3/13948373885254993391 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.9.9/12813592349865671909 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.9.9/8843823720003377982 +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/CACHEDIR.TAG +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/__init__.py +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/__main__.py +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/errors.py +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/interactive.py +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/py313.py +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/tests/TESTING.md +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/tests/__init__.py +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/tests/conftest.py +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/tests/data/comments_sample.txt +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/tests/data/docstrings_sample.txt +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/tests/data/expected_comments_sample.txt +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/tests/data/init.py +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/tests/test_crackerjack_runner.py +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/tests/test_errors.py +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/tests/test_interactive.py +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/tests/test_interactive_run.py +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/tests/test_main.py +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/tests/test_multiline_functions.py +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/tests/test_py313_advanced.py +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/tests/test_py313_features.py +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/tests/test_pytest_features.py +0 -0
- {crackerjack-0.22.2 → crackerjack-0.22.4}/tests/test_structured_errors.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: crackerjack
|
|
3
|
-
Version: 0.22.
|
|
3
|
+
Version: 0.22.4
|
|
4
4
|
Summary: Crackerjack: code quality toolkit
|
|
5
5
|
Keywords: bandit,black,creosote,mypy,pyright,pytest,refurb,ruff
|
|
6
6
|
Author-Email: lesleslie <les@wedgwoodwebworks.com>
|
|
@@ -24,7 +24,7 @@ Project-URL: repository, https://github.com/lesleslie/crackerjack
|
|
|
24
24
|
Requires-Python: >=3.13
|
|
25
25
|
Requires-Dist: autotyping>=24.9
|
|
26
26
|
Requires-Dist: keyring>=25.6
|
|
27
|
-
Requires-Dist: pdm>=2.25.
|
|
27
|
+
Requires-Dist: pdm>=2.25.4
|
|
28
28
|
Requires-Dist: pdm-bump>=0.9.12
|
|
29
29
|
Requires-Dist: pre-commit>=4.2
|
|
30
30
|
Requires-Dist: pydantic>=2.11.7
|
|
@@ -34,12 +34,12 @@ Requires-Dist: pytest-benchmark>=5.1
|
|
|
34
34
|
Requires-Dist: pytest-cov>=6.2.1
|
|
35
35
|
Requires-Dist: pytest-mock>=3.14.1
|
|
36
36
|
Requires-Dist: pytest-timeout>=2.4
|
|
37
|
-
Requires-Dist: pytest-xdist>=3.
|
|
37
|
+
Requires-Dist: pytest-xdist>=3.8
|
|
38
38
|
Requires-Dist: pyyaml>=6.0.2
|
|
39
39
|
Requires-Dist: rich>=14
|
|
40
40
|
Requires-Dist: tomli-w>=1.2
|
|
41
41
|
Requires-Dist: typer>=0.16
|
|
42
|
-
Requires-Dist: uv>=0.7.
|
|
42
|
+
Requires-Dist: uv>=0.7.20
|
|
43
43
|
Description-Content-Type: text/markdown
|
|
44
44
|
|
|
45
45
|
# Crackerjack: Elevate Your Python Development
|
|
Binary file
|
|
@@ -79,37 +79,52 @@ class CodeCleaner(BaseModel, arbitrary_types_allowed=True):
|
|
|
79
79
|
try:
|
|
80
80
|
code = file_path.read_text(encoding="utf-8")
|
|
81
81
|
original_code = code
|
|
82
|
+
cleaning_failed = False
|
|
82
83
|
try:
|
|
83
84
|
code = self.remove_line_comments(code)
|
|
84
85
|
except Exception as e:
|
|
85
86
|
self.console.print(
|
|
86
|
-
f"[
|
|
87
|
+
f"[bright_yellow]⚠️ Warning: Failed to remove line comments from {file_path}: {e}[/bright_yellow]"
|
|
87
88
|
)
|
|
88
89
|
code = original_code
|
|
90
|
+
cleaning_failed = True
|
|
89
91
|
try:
|
|
90
92
|
code = self.remove_docstrings(code)
|
|
91
93
|
except Exception as e:
|
|
92
94
|
self.console.print(
|
|
93
|
-
f"[
|
|
95
|
+
f"[bright_yellow]⚠️ Warning: Failed to remove docstrings from {file_path}: {e}[/bright_yellow]"
|
|
94
96
|
)
|
|
95
97
|
code = original_code
|
|
98
|
+
cleaning_failed = True
|
|
96
99
|
try:
|
|
97
100
|
code = self.remove_extra_whitespace(code)
|
|
98
101
|
except Exception as e:
|
|
99
102
|
self.console.print(
|
|
100
|
-
f"[
|
|
103
|
+
f"[bright_yellow]⚠️ Warning: Failed to remove extra whitespace from {file_path}: {e}[/bright_yellow]"
|
|
101
104
|
)
|
|
102
105
|
code = original_code
|
|
106
|
+
cleaning_failed = True
|
|
103
107
|
try:
|
|
104
108
|
code = self.reformat_code(code)
|
|
105
109
|
except Exception as e:
|
|
106
110
|
self.console.print(
|
|
107
|
-
f"[
|
|
111
|
+
f"[bright_yellow]⚠️ Warning: Failed to reformat {file_path}: {e}[/bright_yellow]"
|
|
108
112
|
)
|
|
109
113
|
code = original_code
|
|
114
|
+
cleaning_failed = True
|
|
110
115
|
file_path.write_text(code, encoding="utf-8")
|
|
111
|
-
|
|
116
|
+
if cleaning_failed:
|
|
117
|
+
self.console.print(
|
|
118
|
+
f"[bright_yellow]⚠️ Partially cleaned: {file_path}[/bright_yellow]"
|
|
119
|
+
)
|
|
120
|
+
else:
|
|
121
|
+
self.console.print(
|
|
122
|
+
f"[bright_green]🧹 Cleaned: {file_path}[/bright_green]"
|
|
123
|
+
)
|
|
112
124
|
except PermissionError as e:
|
|
125
|
+
self.console.print(
|
|
126
|
+
f"[bright_red]❌ Failed to clean: {file_path} (Permission denied)[/bright_red]"
|
|
127
|
+
)
|
|
113
128
|
handle_error(
|
|
114
129
|
ExecutionError(
|
|
115
130
|
message=f"Permission denied while cleaning {file_path}",
|
|
@@ -121,6 +136,9 @@ class CodeCleaner(BaseModel, arbitrary_types_allowed=True):
|
|
|
121
136
|
exit_on_error=False,
|
|
122
137
|
)
|
|
123
138
|
except OSError as e:
|
|
139
|
+
self.console.print(
|
|
140
|
+
f"[bright_red]❌ Failed to clean: {file_path} (File system error)[/bright_red]"
|
|
141
|
+
)
|
|
124
142
|
handle_error(
|
|
125
143
|
ExecutionError(
|
|
126
144
|
message=f"File system error while cleaning {file_path}",
|
|
@@ -132,6 +150,9 @@ class CodeCleaner(BaseModel, arbitrary_types_allowed=True):
|
|
|
132
150
|
exit_on_error=False,
|
|
133
151
|
)
|
|
134
152
|
except UnicodeDecodeError as e:
|
|
153
|
+
self.console.print(
|
|
154
|
+
f"[bright_red]❌ Failed to clean: {file_path} (Encoding error)[/bright_red]"
|
|
155
|
+
)
|
|
135
156
|
handle_error(
|
|
136
157
|
ExecutionError(
|
|
137
158
|
message=f"Encoding error while reading {file_path}",
|
|
@@ -143,6 +164,9 @@ class CodeCleaner(BaseModel, arbitrary_types_allowed=True):
|
|
|
143
164
|
exit_on_error=False,
|
|
144
165
|
)
|
|
145
166
|
except Exception as e:
|
|
167
|
+
self.console.print(
|
|
168
|
+
f"[bright_red]❌ Failed to clean: {file_path} (Unexpected error)[/bright_red]"
|
|
169
|
+
)
|
|
146
170
|
handle_error(
|
|
147
171
|
ExecutionError(
|
|
148
172
|
message=f"Unexpected error while cleaning {file_path}",
|
|
@@ -591,7 +615,7 @@ class CodeCleaner(BaseModel, arbitrary_types_allowed=True):
|
|
|
591
615
|
formatted_code = temp_path.read_text()
|
|
592
616
|
else:
|
|
593
617
|
self.console.print(
|
|
594
|
-
f"[
|
|
618
|
+
f"[bright_yellow]⚠️ Ruff formatting failed: {result.stderr}[/bright_yellow]"
|
|
595
619
|
)
|
|
596
620
|
handle_error(
|
|
597
621
|
ExecutionError(
|
|
@@ -601,10 +625,13 @@ class CodeCleaner(BaseModel, arbitrary_types_allowed=True):
|
|
|
601
625
|
recovery="Check Ruff configuration and formatting rules",
|
|
602
626
|
),
|
|
603
627
|
console=self.console,
|
|
628
|
+
exit_on_error=False,
|
|
604
629
|
)
|
|
605
630
|
formatted_code = code
|
|
606
631
|
except Exception as e:
|
|
607
|
-
self.console.print(
|
|
632
|
+
self.console.print(
|
|
633
|
+
f"[bright_red]❌ Error running Ruff: {e}[/bright_red]"
|
|
634
|
+
)
|
|
608
635
|
handle_error(
|
|
609
636
|
ExecutionError(
|
|
610
637
|
message="Error running Ruff",
|
|
@@ -613,6 +640,7 @@ class CodeCleaner(BaseModel, arbitrary_types_allowed=True):
|
|
|
613
640
|
recovery="Verify Ruff is installed and configured correctly",
|
|
614
641
|
),
|
|
615
642
|
console=self.console,
|
|
643
|
+
exit_on_error=False,
|
|
616
644
|
)
|
|
617
645
|
formatted_code = code
|
|
618
646
|
finally:
|
|
@@ -620,7 +648,9 @@ class CodeCleaner(BaseModel, arbitrary_types_allowed=True):
|
|
|
620
648
|
temp_path.unlink()
|
|
621
649
|
return formatted_code
|
|
622
650
|
except Exception as e:
|
|
623
|
-
self.console.print(
|
|
651
|
+
self.console.print(
|
|
652
|
+
f"[bright_red]❌ Error during reformatting: {e}[/bright_red]"
|
|
653
|
+
)
|
|
624
654
|
handle_error(
|
|
625
655
|
ExecutionError(
|
|
626
656
|
message="Error during reformatting",
|
|
@@ -792,7 +822,7 @@ class ConfigManager(BaseModel, arbitrary_types_allowed=True):
|
|
|
792
822
|
self, cmd: list[str], **kwargs: t.Any
|
|
793
823
|
) -> subprocess.CompletedProcess[str]:
|
|
794
824
|
if self.dry_run:
|
|
795
|
-
self.console.print(f"[
|
|
825
|
+
self.console.print(f"[dim cyan]🔍 Would run: {' '.join(cmd)}[/dim cyan]")
|
|
796
826
|
return CompletedProcess(cmd, 0, "", "")
|
|
797
827
|
return execute(cmd, **kwargs)
|
|
798
828
|
|
|
@@ -814,7 +844,7 @@ class ProjectManager(BaseModel, arbitrary_types_allowed=True):
|
|
|
814
844
|
["pdm", "list", "--freeze"], capture_output=True, text=True
|
|
815
845
|
).stdout.splitlines()
|
|
816
846
|
if not len([pkg for pkg in installed_pkgs if "pre-commit" in pkg]):
|
|
817
|
-
self.console.print("Initializing project...")
|
|
847
|
+
self.console.print("[bright_blue]🚀 Initializing project...[/bright_blue]")
|
|
818
848
|
self.execute_command(["pdm", "self", "add", "keyring"])
|
|
819
849
|
self.execute_command(["pdm", "config", "python.use_uv", "true"])
|
|
820
850
|
self.execute_command(["git", "init"])
|
|
@@ -829,7 +859,9 @@ class ProjectManager(BaseModel, arbitrary_types_allowed=True):
|
|
|
829
859
|
self.config_manager.update_pyproject_configs()
|
|
830
860
|
|
|
831
861
|
def run_pre_commit(self) -> None:
|
|
832
|
-
self.console.print(
|
|
862
|
+
self.console.print(
|
|
863
|
+
"\n[bright_blue]🔍 Running pre-commit hooks...[/bright_blue]\n"
|
|
864
|
+
)
|
|
833
865
|
cmd = ["pre-commit", "run", "--all-files"]
|
|
834
866
|
if hasattr(self, "options") and getattr(self.options, "ai_agent", False):
|
|
835
867
|
cmd.extend(["-c", ".pre-commit-config-ai.yaml"])
|
|
@@ -837,14 +869,16 @@ class ProjectManager(BaseModel, arbitrary_types_allowed=True):
|
|
|
837
869
|
if check_all.returncode > 0:
|
|
838
870
|
check_all = self.execute_command(cmd)
|
|
839
871
|
if check_all.returncode > 0:
|
|
840
|
-
self.console.print(
|
|
872
|
+
self.console.print(
|
|
873
|
+
"\n\n[bright_red]❌ Pre-commit failed. Please fix errors.[/bright_red]\n"
|
|
874
|
+
)
|
|
841
875
|
raise SystemExit(1)
|
|
842
876
|
|
|
843
877
|
def execute_command(
|
|
844
878
|
self, cmd: list[str], **kwargs: t.Any
|
|
845
879
|
) -> subprocess.CompletedProcess[str]:
|
|
846
880
|
if self.dry_run:
|
|
847
|
-
self.console.print(f"[
|
|
881
|
+
self.console.print(f"[dim cyan]🔍 Would run: {' '.join(cmd)}[/dim cyan]")
|
|
848
882
|
return CompletedProcess(cmd, 0, "", "")
|
|
849
883
|
return execute(cmd, **kwargs)
|
|
850
884
|
|
|
@@ -887,7 +921,7 @@ class Crackerjack(BaseModel, arbitrary_types_allowed=True):
|
|
|
887
921
|
self.pkg_name = self.pkg_path.stem.lower().replace("-", "_")
|
|
888
922
|
self.pkg_dir = self.pkg_path / self.pkg_name
|
|
889
923
|
self.pkg_dir.mkdir(exist_ok=True)
|
|
890
|
-
self.console.print("\
|
|
924
|
+
self.console.print("\n[bright_magenta]🎯 Crackerjacking...[/bright_magenta]\n")
|
|
891
925
|
self.config_manager.pkg_name = self.pkg_name
|
|
892
926
|
self.project_manager.pkg_name = self.pkg_name
|
|
893
927
|
self.project_manager.pkg_dir = self.pkg_dir
|
|
@@ -899,9 +933,11 @@ class Crackerjack(BaseModel, arbitrary_types_allowed=True):
|
|
|
899
933
|
["pdm", "install"], capture_output=True, text=True
|
|
900
934
|
)
|
|
901
935
|
if result.returncode == 0:
|
|
902
|
-
self.console.print("PDM installed
|
|
936
|
+
self.console.print("[bright_green]✅ PDM installed[/bright_green]\n")
|
|
903
937
|
self.execute_command(["pdm", "lock"])
|
|
904
|
-
self.console.print(
|
|
938
|
+
self.console.print(
|
|
939
|
+
"[bright_green]✅ Lock file updated[/bright_green]\n"
|
|
940
|
+
)
|
|
905
941
|
else:
|
|
906
942
|
self.console.print(
|
|
907
943
|
"\n\n❌ PDM installation failed. Is PDM is installed? Run `pipx install pdm` and try again.\n\n"
|
|
@@ -921,7 +957,9 @@ class Crackerjack(BaseModel, arbitrary_types_allowed=True):
|
|
|
921
957
|
if self.pkg_path.stem == "crackerjack":
|
|
922
958
|
tests_dir = self.pkg_path / "tests"
|
|
923
959
|
if tests_dir.exists() and tests_dir.is_dir():
|
|
924
|
-
self.console.print(
|
|
960
|
+
self.console.print(
|
|
961
|
+
"\n[bright_blue]🧹 Cleaning tests directory...[/bright_blue]\n"
|
|
962
|
+
)
|
|
925
963
|
self.code_cleaner.clean_files(tests_dir)
|
|
926
964
|
|
|
927
965
|
def _get_test_timeout(self, options: OptionsProtocol, project_size: str) -> int:
|
|
@@ -1018,26 +1056,34 @@ class Crackerjack(BaseModel, arbitrary_types_allowed=True):
|
|
|
1018
1056
|
|
|
1019
1057
|
def _print_ai_agent_files(self, options: t.Any) -> None:
|
|
1020
1058
|
if getattr(options, "ai_agent", False):
|
|
1021
|
-
self.console.print(
|
|
1022
|
-
|
|
1059
|
+
self.console.print(
|
|
1060
|
+
"[dim cyan]📄 Structured test results: test-results.xml[/dim cyan]"
|
|
1061
|
+
)
|
|
1062
|
+
self.console.print("[dim cyan]📊 Coverage report: coverage.json[/dim cyan]")
|
|
1023
1063
|
if options.benchmark or options.benchmark_regression:
|
|
1024
|
-
self.console.print(
|
|
1064
|
+
self.console.print(
|
|
1065
|
+
"[dim cyan]⏱️ Benchmark results: benchmark.json[/dim cyan]"
|
|
1066
|
+
)
|
|
1025
1067
|
|
|
1026
1068
|
def _handle_test_failure(self, result: t.Any, options: t.Any) -> None:
|
|
1027
1069
|
if result.stderr:
|
|
1028
1070
|
self.console.print(result.stderr)
|
|
1029
|
-
self.console.print(
|
|
1071
|
+
self.console.print(
|
|
1072
|
+
"\n\n[bright_red]❌ Tests failed. Please fix errors.[/bright_red]\n"
|
|
1073
|
+
)
|
|
1030
1074
|
self._print_ai_agent_files(options)
|
|
1031
1075
|
raise SystemExit(1)
|
|
1032
1076
|
|
|
1033
1077
|
def _handle_test_success(self, options: t.Any) -> None:
|
|
1034
|
-
self.console.print(
|
|
1078
|
+
self.console.print(
|
|
1079
|
+
"\n\n[bright_green]✅ Tests passed successfully![/bright_green]\n"
|
|
1080
|
+
)
|
|
1035
1081
|
self._print_ai_agent_files(options)
|
|
1036
1082
|
|
|
1037
1083
|
def _run_tests(self, options: t.Any) -> None:
|
|
1038
1084
|
if not options.test:
|
|
1039
1085
|
return
|
|
1040
|
-
self.console.print("\n\
|
|
1086
|
+
self.console.print("\n\n[bright_blue]🧪 Running tests...[/bright_blue]\n")
|
|
1041
1087
|
test_command = self._prepare_pytest_command(options)
|
|
1042
1088
|
result = self.execute_command(test_command, capture_output=True, text=True)
|
|
1043
1089
|
if result.stdout:
|
|
@@ -1058,7 +1104,7 @@ class Crackerjack(BaseModel, arbitrary_types_allowed=True):
|
|
|
1058
1104
|
default=False,
|
|
1059
1105
|
):
|
|
1060
1106
|
self.console.print(
|
|
1061
|
-
f"[yellow]Skipping {option} version bump[/yellow]"
|
|
1107
|
+
f"[dim yellow]⏭️ Skipping {option} version bump[/dim yellow]"
|
|
1062
1108
|
)
|
|
1063
1109
|
return
|
|
1064
1110
|
self.execute_command(["pdm", "bump", option])
|
|
@@ -1072,7 +1118,9 @@ class Crackerjack(BaseModel, arbitrary_types_allowed=True):
|
|
|
1072
1118
|
self.console.print(build.stdout)
|
|
1073
1119
|
if build.returncode > 0:
|
|
1074
1120
|
self.console.print(build.stderr)
|
|
1075
|
-
self.console.print(
|
|
1121
|
+
self.console.print(
|
|
1122
|
+
"\n\n[bright_red]❌ Build failed. Please fix errors.[/bright_red]\n"
|
|
1123
|
+
)
|
|
1076
1124
|
raise SystemExit(1)
|
|
1077
1125
|
self.execute_command(["pdm", "publish", "--no-build"])
|
|
1078
1126
|
|
|
@@ -1088,7 +1136,7 @@ class Crackerjack(BaseModel, arbitrary_types_allowed=True):
|
|
|
1088
1136
|
self, cmd: list[str], **kwargs: t.Any
|
|
1089
1137
|
) -> subprocess.CompletedProcess[str]:
|
|
1090
1138
|
if self.dry_run:
|
|
1091
|
-
self.console.print(f"[
|
|
1139
|
+
self.console.print(f"[dim cyan]🔍 Would run: {' '.join(cmd)}[/dim cyan]")
|
|
1092
1140
|
return CompletedProcess(cmd, 0, "", "")
|
|
1093
1141
|
return execute(cmd, **kwargs)
|
|
1094
1142
|
|
|
@@ -1106,12 +1154,12 @@ class Crackerjack(BaseModel, arbitrary_types_allowed=True):
|
|
|
1106
1154
|
if not options.skip_hooks:
|
|
1107
1155
|
self.project_manager.run_pre_commit()
|
|
1108
1156
|
else:
|
|
1109
|
-
self.console.print("Skipping pre-commit hooks")
|
|
1157
|
+
self.console.print("[dim yellow]⏭️ Skipping pre-commit hooks[/dim yellow]")
|
|
1110
1158
|
self._run_tests(options)
|
|
1111
1159
|
self._bump_version(options)
|
|
1112
1160
|
self._publish_project(options)
|
|
1113
1161
|
self._commit_and_push(options)
|
|
1114
|
-
self.console.print("\n🍺 Crackerjack complete
|
|
1162
|
+
self.console.print("\n[bright_green]🍺 Crackerjack complete![/bright_green]\n")
|
|
1115
1163
|
|
|
1116
1164
|
|
|
1117
1165
|
crackerjack_it = Crackerjack().process
|
|
@@ -4,7 +4,7 @@ requires = [ "pdm-backend" ]
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "crackerjack"
|
|
7
|
-
version = "0.22.
|
|
7
|
+
version = "0.22.3"
|
|
8
8
|
description = "Crackerjack: code quality toolkit"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
keywords = [
|
|
@@ -43,7 +43,7 @@ classifiers = [
|
|
|
43
43
|
dependencies = [
|
|
44
44
|
"autotyping>=24.9",
|
|
45
45
|
"keyring>=25.6",
|
|
46
|
-
"pdm>=2.25.
|
|
46
|
+
"pdm>=2.25.4",
|
|
47
47
|
"pdm-bump>=0.9.12",
|
|
48
48
|
"pre-commit>=4.2",
|
|
49
49
|
"pydantic>=2.11.7",
|
|
@@ -53,12 +53,12 @@ dependencies = [
|
|
|
53
53
|
"pytest-cov>=6.2.1",
|
|
54
54
|
"pytest-mock>=3.14.1",
|
|
55
55
|
"pytest-timeout>=2.4",
|
|
56
|
-
"pytest-xdist>=3.
|
|
56
|
+
"pytest-xdist>=3.8",
|
|
57
57
|
"pyyaml>=6.0.2",
|
|
58
58
|
"rich>=14",
|
|
59
59
|
"tomli-w>=1.2",
|
|
60
60
|
"typer>=0.16",
|
|
61
|
-
"uv>=0.7.
|
|
61
|
+
"uv>=0.7.20",
|
|
62
62
|
]
|
|
63
63
|
urls.documentation = "https://github.com/lesleslie/crackerjack"
|
|
64
64
|
urls.homepage = "https://github.com/lesleslie/crackerjack"
|
|
@@ -6,7 +6,7 @@ requires = [
|
|
|
6
6
|
|
|
7
7
|
[project]
|
|
8
8
|
name = "crackerjack"
|
|
9
|
-
version = "0.22.
|
|
9
|
+
version = "0.22.4"
|
|
10
10
|
description = "Crackerjack: code quality toolkit"
|
|
11
11
|
readme = "README.md"
|
|
12
12
|
keywords = [
|
|
@@ -43,7 +43,7 @@ classifiers = [
|
|
|
43
43
|
dependencies = [
|
|
44
44
|
"autotyping>=24.9",
|
|
45
45
|
"keyring>=25.6",
|
|
46
|
-
"pdm>=2.25.
|
|
46
|
+
"pdm>=2.25.4",
|
|
47
47
|
"pdm-bump>=0.9.12",
|
|
48
48
|
"pre-commit>=4.2",
|
|
49
49
|
"pydantic>=2.11.7",
|
|
@@ -53,12 +53,12 @@ dependencies = [
|
|
|
53
53
|
"pytest-cov>=6.2.1",
|
|
54
54
|
"pytest-mock>=3.14.1",
|
|
55
55
|
"pytest-timeout>=2.4",
|
|
56
|
-
"pytest-xdist>=3.
|
|
56
|
+
"pytest-xdist>=3.8",
|
|
57
57
|
"pyyaml>=6.0.2",
|
|
58
58
|
"rich>=14",
|
|
59
59
|
"tomli-w>=1.2",
|
|
60
60
|
"typer>=0.16",
|
|
61
|
-
"uv>=0.7.
|
|
61
|
+
"uv>=0.7.20",
|
|
62
62
|
]
|
|
63
63
|
|
|
64
64
|
[project.license]
|
|
@@ -500,7 +500,9 @@ class TestCrackerjackProcess:
|
|
|
500
500
|
mock_tests.assert_called_once()
|
|
501
501
|
mock_publish.assert_called_once()
|
|
502
502
|
mock_commit.assert_called_once()
|
|
503
|
-
mock_console_print.assert_any_call(
|
|
503
|
+
mock_console_print.assert_any_call(
|
|
504
|
+
"\n[bright_green]🍺 Crackerjack complete![/bright_green]\n"
|
|
505
|
+
)
|
|
504
506
|
|
|
505
507
|
def test_process_with_all_option_sets_flags(
|
|
506
508
|
self,
|
|
@@ -672,7 +674,9 @@ class TestCrackerjackProcess:
|
|
|
672
674
|
cj = Crackerjack(dry_run=True)
|
|
673
675
|
with suppress(SystemExit):
|
|
674
676
|
cj.process(options)
|
|
675
|
-
mock_console_print.assert_any_call(
|
|
677
|
+
mock_console_print.assert_any_call(
|
|
678
|
+
"\n\n[bright_red]❌ Tests failed. Please fix errors.[/bright_red]\n"
|
|
679
|
+
)
|
|
676
680
|
mock_cj_execute.assert_called_once()
|
|
677
681
|
|
|
678
682
|
def test_process_with_failed_build(
|
|
@@ -701,7 +705,9 @@ class TestCrackerjackProcess:
|
|
|
701
705
|
cj = Crackerjack(dry_run=True)
|
|
702
706
|
with suppress(SystemExit):
|
|
703
707
|
cj.process(options)
|
|
704
|
-
mock_console_print.assert_any_call(
|
|
708
|
+
mock_console_print.assert_any_call(
|
|
709
|
+
"\n\n[bright_red]❌ Build failed. Please fix errors.[/bright_red]\n"
|
|
710
|
+
)
|
|
705
711
|
|
|
706
712
|
def test_publish_project_darwin(self) -> None:
|
|
707
713
|
options = OptionsForTesting(publish=BumpOption.micro)
|
|
Binary file
|
|
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
|
{crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.1.11/3256171999636029978
RENAMED
|
File without changes
|
|
File without changes
|
{crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.1.4/10355199064880463147
RENAMED
|
File without changes
|
{crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.1.6/15140459877605758699
RENAMED
|
File without changes
|
|
File without changes
|
{crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.1.9/17041001205004563469
RENAMED
|
File without changes
|
{crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.11.11/18187162184424859798
RENAMED
|
File without changes
|
{crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.11.12/16869036553936192448
RENAMED
|
File without changes
|
{crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.11.12/1867267426380906393
RENAMED
|
File without changes
|
{crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.11.12/4240757255861806333
RENAMED
|
File without changes
|
{crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.11.12/4441409093023629623
RENAMED
|
File without changes
|
{crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.11.13/1867267426380906393
RENAMED
|
File without changes
|
{crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.11.13/4240757255861806333
RENAMED
|
File without changes
|
{crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.11.2/4070660268492669020
RENAMED
|
File without changes
|
{crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.11.3/9818742842212983150
RENAMED
|
File without changes
|
{crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.11.4/9818742842212983150
RENAMED
|
File without changes
|
{crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.11.6/3557596832929915217
RENAMED
|
File without changes
|
{crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.11.7/10386934055395314831
RENAMED
|
File without changes
|
{crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.11.7/3557596832929915217
RENAMED
|
File without changes
|
|
File without changes
|
{crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.12.0/5056746222905752453
RENAMED
|
File without changes
|
{crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.2.0/10047773857155985907
RENAMED
|
File without changes
|
|
File without changes
|
{crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.2.2/18053836298936336950
RENAMED
|
File without changes
|
{crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.3.0/12548816621480535786
RENAMED
|
File without changes
|
{crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.3.3/11081883392474770722
RENAMED
|
File without changes
|
|
File without changes
|
{crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.3.5/16311176246009842383
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.6.0/11982804814124138945
RENAMED
|
File without changes
|
{crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.6.0/12055761203849489982
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
|
{crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.7.3/16061516852537040135
RENAMED
|
File without changes
|
{crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.8.4/16354268377385700367
RENAMED
|
File without changes
|
{crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.9.10/12813592349865671909
RENAMED
|
File without changes
|
|
File without changes
|
{crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.9.3/13948373885254993391
RENAMED
|
File without changes
|
{crackerjack-0.22.2 → crackerjack-0.22.4}/crackerjack/.ruff_cache/0.9.9/12813592349865671909
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
|
|
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
|