crackerjack 0.19.8__tar.gz → 0.20.1__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.
Files changed (87) hide show
  1. {crackerjack-0.19.8 → crackerjack-0.20.1}/PKG-INFO +96 -4
  2. {crackerjack-0.19.8 → crackerjack-0.20.1}/README.md +94 -2
  3. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.gitignore +2 -0
  4. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.pre-commit-config.yaml +2 -2
  5. crackerjack-0.20.1/crackerjack/.ruff_cache/0.11.12/1867267426380906393 +0 -0
  6. crackerjack-0.20.1/crackerjack/.ruff_cache/0.11.12/4240757255861806333 +0 -0
  7. crackerjack-0.20.1/crackerjack/.ruff_cache/0.11.13/1867267426380906393 +0 -0
  8. crackerjack-0.20.1/crackerjack/__init__.py +42 -0
  9. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/__main__.py +39 -3
  10. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/crackerjack.py +474 -66
  11. crackerjack-0.20.1/crackerjack/errors.py +176 -0
  12. crackerjack-0.20.1/crackerjack/interactive.py +487 -0
  13. crackerjack-0.20.1/crackerjack/py313.py +221 -0
  14. crackerjack-0.20.1/crackerjack/pyproject.toml +239 -0
  15. {crackerjack-0.19.8 → crackerjack-0.20.1}/pyproject.toml +3 -3
  16. {crackerjack-0.19.8 → crackerjack-0.20.1}/tests/test_crackerjack.py +82 -76
  17. {crackerjack-0.19.8 → crackerjack-0.20.1}/tests/test_crackerjack_runner.py +2 -0
  18. crackerjack-0.20.1/tests/test_errors.py +171 -0
  19. crackerjack-0.20.1/tests/test_interactive.py +452 -0
  20. crackerjack-0.20.1/tests/test_interactive_run.py +162 -0
  21. crackerjack-0.20.1/tests/test_py313_advanced.py +162 -0
  22. crackerjack-0.20.1/tests/test_py313_features.py +175 -0
  23. crackerjack-0.20.1/tests/test_structured_errors.py +159 -0
  24. crackerjack-0.19.8/crackerjack/.ruff_cache/0.11.12/1867267426380906393 +0 -0
  25. crackerjack-0.19.8/crackerjack/__init__.py +0 -5
  26. crackerjack-0.19.8/crackerjack/pyproject.toml +0 -239
  27. {crackerjack-0.19.8 → crackerjack-0.20.1}/LICENSE +0 -0
  28. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.libcst.codemod.yaml +0 -0
  29. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.pdm.toml +0 -0
  30. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.pytest_cache/.gitignore +0 -0
  31. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.pytest_cache/CACHEDIR.TAG +0 -0
  32. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.pytest_cache/README.md +0 -0
  33. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.pytest_cache/v/cache/nodeids +0 -0
  34. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.pytest_cache/v/cache/stepwise +0 -0
  35. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/.gitignore +0 -0
  36. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.1.11/3256171999636029978 +0 -0
  37. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.1.14/602324811142551221 +0 -0
  38. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.1.4/10355199064880463147 +0 -0
  39. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.1.6/15140459877605758699 +0 -0
  40. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.1.7/1790508110482614856 +0 -0
  41. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.1.9/17041001205004563469 +0 -0
  42. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.11.11/18187162184424859798 +0 -0
  43. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.11.12/16869036553936192448 +0 -0
  44. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.11.12/4441409093023629623 +0 -0
  45. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.11.2/4070660268492669020 +0 -0
  46. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.11.3/9818742842212983150 +0 -0
  47. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.11.4/9818742842212983150 +0 -0
  48. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.11.6/3557596832929915217 +0 -0
  49. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.11.7/10386934055395314831 +0 -0
  50. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.11.7/3557596832929915217 +0 -0
  51. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.11.8/530407680854991027 +0 -0
  52. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.2.0/10047773857155985907 +0 -0
  53. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.2.1/8522267973936635051 +0 -0
  54. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.2.2/18053836298936336950 +0 -0
  55. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.3.0/12548816621480535786 +0 -0
  56. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.3.3/11081883392474770722 +0 -0
  57. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.3.4/676973378459347183 +0 -0
  58. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.3.5/16311176246009842383 +0 -0
  59. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.5.7/1493622539551733492 +0 -0
  60. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.5.7/6231957614044513175 +0 -0
  61. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.5.7/9932762556785938009 +0 -0
  62. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.6.0/11982804814124138945 +0 -0
  63. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.6.0/12055761203849489982 +0 -0
  64. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.6.2/1206147804896221174 +0 -0
  65. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.6.4/1206147804896221174 +0 -0
  66. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.6.5/1206147804896221174 +0 -0
  67. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.6.7/3657366982708166874 +0 -0
  68. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.6.9/285614542852677309 +0 -0
  69. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.7.1/1024065805990144819 +0 -0
  70. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.7.1/285614542852677309 +0 -0
  71. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.7.3/16061516852537040135 +0 -0
  72. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.8.4/16354268377385700367 +0 -0
  73. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.9.10/12813592349865671909 +0 -0
  74. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.9.10/923908772239632759 +0 -0
  75. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.9.3/13948373885254993391 +0 -0
  76. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.9.9/12813592349865671909 +0 -0
  77. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/0.9.9/8843823720003377982 +0 -0
  78. {crackerjack-0.19.8 → crackerjack-0.20.1}/crackerjack/.ruff_cache/CACHEDIR.TAG +0 -0
  79. {crackerjack-0.19.8 → crackerjack-0.20.1}/tests/TESTING.md +0 -0
  80. {crackerjack-0.19.8 → crackerjack-0.20.1}/tests/__init__.py +0 -0
  81. {crackerjack-0.19.8 → crackerjack-0.20.1}/tests/conftest.py +0 -0
  82. {crackerjack-0.19.8 → crackerjack-0.20.1}/tests/data/comments_sample.txt +0 -0
  83. {crackerjack-0.19.8 → crackerjack-0.20.1}/tests/data/docstrings_sample.txt +0 -0
  84. {crackerjack-0.19.8 → crackerjack-0.20.1}/tests/data/expected_comments_sample.txt +0 -0
  85. {crackerjack-0.19.8 → crackerjack-0.20.1}/tests/data/init.py +0 -0
  86. {crackerjack-0.19.8 → crackerjack-0.20.1}/tests/test_main.py +0 -0
  87. {crackerjack-0.19.8 → crackerjack-0.20.1}/tests/test_pytest_features.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: crackerjack
3
- Version: 0.19.8
3
+ Version: 0.20.1
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>
@@ -37,7 +37,7 @@ Requires-Dist: pytest-xdist>=3.7
37
37
  Requires-Dist: rich>=14
38
38
  Requires-Dist: tomli-w>=1.2
39
39
  Requires-Dist: typer>=0.16
40
- Requires-Dist: uv>=0.7.10
40
+ Requires-Dist: uv>=0.7.12
41
41
  Description-Content-Type: text/markdown
42
42
 
43
43
  # Crackerjack: Elevate Your Python Development
@@ -82,7 +82,7 @@ Crackerjack integrates powerful tools like Ruff, PDM, pre-commit, pytest, and mo
82
82
  ### Quick Start
83
83
 
84
84
  If you're new to Crackerjack, follow these steps:
85
- 1. **Install Python 3.13:** Ensure you have Python 3.13 installed.
85
+ 1. **Install Python 3.13:** Ensure you have Python 3.13 or higher installed.
86
86
  2. **Install PDM:**
87
87
  ```
88
88
  pipx install pdm
@@ -98,6 +98,11 @@ If you're new to Crackerjack, follow these steps:
98
98
  python -m crackerjack
99
99
  ```
100
100
 
101
+ Or use the interactive Rich UI:
102
+ ```
103
+ python -m crackerjack --rich-ui
104
+ ```
105
+
101
106
  ---
102
107
 
103
108
  ## The Crackerjack Philosophy
@@ -137,9 +142,12 @@ Crackerjack is built on the following core principles:
137
142
 
138
143
  ### Developer Experience
139
144
  - **Command-Line Interface:** Simple, intuitive CLI with comprehensive options
145
+ - **Interactive Rich UI:** Visual workflow with real-time task tracking, progress visualization, and interactive prompts
146
+ - **Structured Error Handling:** Clear error messages with error codes, detailed explanations, and recovery suggestions
140
147
  - **Programmatic API:** Can be integrated into your own Python scripts and workflows
141
148
  - **AI Agent Integration:** Structured output format for integration with AI assistants, with complete style rules available in [RULES.md](RULES.md) for AI tool customization
142
149
  - **Verbose Mode:** Detailed output for debugging and understanding what's happening
150
+ - **Python 3.13+ Features:** Leverages the latest Python language features including PEP 695 type parameter syntax, Self type annotations, and structural pattern matching
143
151
 
144
152
  ## Pre-commit Hooks
145
153
 
@@ -217,7 +225,7 @@ python -m crackerjack -t --benchmark-regression --benchmark-regression-threshold
217
225
 
218
226
  ## Installation
219
227
 
220
- 1. **Python:** Ensure you have Python 3.13 installed.
228
+ 1. **Python:** Ensure you have Python 3.13 or higher installed.
221
229
  2. **PDM:** Install [PDM](https://pdm.fming.dev/) using `pipx`:
222
230
 
223
231
  ```
@@ -231,6 +239,11 @@ python -m crackerjack -t --benchmark-regression --benchmark-regression-threshold
231
239
  python -m crackerjack
232
240
  ```
233
241
 
242
+ Or with the interactive Rich UI:
243
+ ```
244
+ python -m crackerjack --rich-ui
245
+ ```
246
+
234
247
  ## Usage
235
248
 
236
249
  ### Command Line
@@ -312,6 +325,7 @@ runner.process(MyOptions())
312
325
  - `--benchmark-regression`: Fail tests if benchmarks regress beyond threshold.
313
326
  - `--benchmark-regression-threshold`: Set threshold percentage for benchmark regression (default 5.0%).
314
327
  - `-a`, `--all`: Run with `-x -t -p <micro|minor|major> -c` development options.
328
+ - `--rich-ui`: Enable the interactive Rich UI for a more user-friendly experience with visual progress tracking and interactive prompts.
315
329
  - `--ai-agent`: Enable AI agent mode with structured output (see [AI Agent Integration](#ai-agent-integration)).
316
330
  - `--help`: Display help.
317
331
 
@@ -387,6 +401,11 @@ runner.process(MyOptions())
387
401
  python -m crackerjack -i
388
402
  ```
389
403
 
404
+ - **Rich Interactive Mode** - Run with the interactive Rich UI:
405
+ ```bash
406
+ python -m crackerjack --rich-ui
407
+ ```
408
+
390
409
  - **AI Integration** - Run with structured output for AI tools:
391
410
  ```bash
392
411
  python -m crackerjack --ai-agent --test
@@ -413,6 +432,79 @@ python -m crackerjack --ai-agent --test
413
432
 
414
433
  For detailed information about using Crackerjack with AI agents, including the structured output format and programmatic usage, see [README-AI-AGENT.md](README-AI-AGENT.md).
415
434
 
435
+ ## Interactive Rich UI
436
+
437
+ Crackerjack now offers an enhanced interactive experience through its Rich UI:
438
+
439
+ - **Visual Workflow:** See a visual representation of the entire task workflow with dependencies
440
+ - **Real-time Progress:** Track task progress with interactive progress bars and status indicators
441
+ - **Task Management:** Confirm tasks before execution and view detailed status information
442
+ - **Error Visualization:** Errors are presented in a structured, easy-to-understand format with recovery suggestions
443
+ - **File Selection:** Interactive file browser for operations that require selecting files
444
+
445
+ To use the Rich UI, run Crackerjack with the `--rich-ui` flag:
446
+
447
+ ```bash
448
+ python -m crackerjack --rich-ui
449
+ ```
450
+
451
+ This launches an interactive terminal interface where you can:
452
+ 1. View all available tasks and their dependencies
453
+ 2. Confirm each task before execution
454
+ 3. Get detailed status information for running tasks
455
+ 4. See a summary of completed, failed, and skipped tasks
456
+ 5. Visualize error details with recovery suggestions
457
+
458
+ ## Structured Error Handling
459
+
460
+ Crackerjack implements a comprehensive error handling system that provides:
461
+
462
+ - **Error Categories:** Errors are categorized by type (configuration, execution, testing, etc.)
463
+ - **Error Codes:** Each error has a unique numeric code for easy reference
464
+ - **Detailed Messages:** Clear, descriptive messages explain what went wrong
465
+ - **Recovery Suggestions:** Where possible, errors include recovery suggestions to help resolve issues
466
+ - **Rich Formatting:** Errors are presented with clear visual formatting (when using Rich UI or verbose mode)
467
+
468
+ Error types include:
469
+ - Configuration errors (1000-1999)
470
+ - Execution errors (2000-2999)
471
+ - Test errors (3000-3999)
472
+ - Publishing errors (4000-4999)
473
+ - Git errors (5000-5999)
474
+ - File operation errors (6000-6999)
475
+ - Code cleaning errors (7000-7999)
476
+ - Generic errors (9000-9999)
477
+
478
+ Use the `-v` or `--verbose` flag to see more detailed error information:
479
+
480
+ ```bash
481
+ python -m crackerjack -v
482
+ ```
483
+
484
+ For the most comprehensive error details with visual formatting, combine verbose mode with the Rich UI:
485
+
486
+ ```bash
487
+ python -m crackerjack --rich-ui -v
488
+ ```
489
+
490
+ ## Python 3.13+ Features
491
+
492
+ Crackerjack is designed to leverage the latest Python 3.13+ language features:
493
+
494
+ - **Type Parameter Syntax (PEP 695):** Uses the new, more concise syntax for generic type parameters
495
+ - **Self Type:** Leverages the `Self` type for better method chaining and builder patterns
496
+ - **Structural Pattern Matching:** Uses pattern matching for cleaner code, especially in configuration and command processing
497
+ - **Enhanced Type Hints:** More precise type hints with union types using the pipe operator
498
+ - **Modern Dictionary Patterns:** Leverages structural pattern matching with dictionaries for cleaner data handling
499
+
500
+ These modern Python features contribute to:
501
+ - More readable and maintainable code
502
+ - Better static type checking with tools like pyright
503
+ - Cleaner, more concise implementations
504
+ - Enhanced error handling and pattern recognition
505
+
506
+ Crackerjack provides examples of these features in action, serving as a reference for modern Python development practices.
507
+
416
508
  ## Contributing
417
509
 
418
510
  Crackerjack is an evolving project. Contributions are welcome! Please open a pull request or issue.
@@ -40,7 +40,7 @@ Crackerjack integrates powerful tools like Ruff, PDM, pre-commit, pytest, and mo
40
40
  ### Quick Start
41
41
 
42
42
  If you're new to Crackerjack, follow these steps:
43
- 1. **Install Python 3.13:** Ensure you have Python 3.13 installed.
43
+ 1. **Install Python 3.13:** Ensure you have Python 3.13 or higher installed.
44
44
  2. **Install PDM:**
45
45
  ```
46
46
  pipx install pdm
@@ -56,6 +56,11 @@ If you're new to Crackerjack, follow these steps:
56
56
  python -m crackerjack
57
57
  ```
58
58
 
59
+ Or use the interactive Rich UI:
60
+ ```
61
+ python -m crackerjack --rich-ui
62
+ ```
63
+
59
64
  ---
60
65
 
61
66
  ## The Crackerjack Philosophy
@@ -95,9 +100,12 @@ Crackerjack is built on the following core principles:
95
100
 
96
101
  ### Developer Experience
97
102
  - **Command-Line Interface:** Simple, intuitive CLI with comprehensive options
103
+ - **Interactive Rich UI:** Visual workflow with real-time task tracking, progress visualization, and interactive prompts
104
+ - **Structured Error Handling:** Clear error messages with error codes, detailed explanations, and recovery suggestions
98
105
  - **Programmatic API:** Can be integrated into your own Python scripts and workflows
99
106
  - **AI Agent Integration:** Structured output format for integration with AI assistants, with complete style rules available in [RULES.md](RULES.md) for AI tool customization
100
107
  - **Verbose Mode:** Detailed output for debugging and understanding what's happening
108
+ - **Python 3.13+ Features:** Leverages the latest Python language features including PEP 695 type parameter syntax, Self type annotations, and structural pattern matching
101
109
 
102
110
  ## Pre-commit Hooks
103
111
 
@@ -175,7 +183,7 @@ python -m crackerjack -t --benchmark-regression --benchmark-regression-threshold
175
183
 
176
184
  ## Installation
177
185
 
178
- 1. **Python:** Ensure you have Python 3.13 installed.
186
+ 1. **Python:** Ensure you have Python 3.13 or higher installed.
179
187
  2. **PDM:** Install [PDM](https://pdm.fming.dev/) using `pipx`:
180
188
 
181
189
  ```
@@ -189,6 +197,11 @@ python -m crackerjack -t --benchmark-regression --benchmark-regression-threshold
189
197
  python -m crackerjack
190
198
  ```
191
199
 
200
+ Or with the interactive Rich UI:
201
+ ```
202
+ python -m crackerjack --rich-ui
203
+ ```
204
+
192
205
  ## Usage
193
206
 
194
207
  ### Command Line
@@ -270,6 +283,7 @@ runner.process(MyOptions())
270
283
  - `--benchmark-regression`: Fail tests if benchmarks regress beyond threshold.
271
284
  - `--benchmark-regression-threshold`: Set threshold percentage for benchmark regression (default 5.0%).
272
285
  - `-a`, `--all`: Run with `-x -t -p <micro|minor|major> -c` development options.
286
+ - `--rich-ui`: Enable the interactive Rich UI for a more user-friendly experience with visual progress tracking and interactive prompts.
273
287
  - `--ai-agent`: Enable AI agent mode with structured output (see [AI Agent Integration](#ai-agent-integration)).
274
288
  - `--help`: Display help.
275
289
 
@@ -345,6 +359,11 @@ runner.process(MyOptions())
345
359
  python -m crackerjack -i
346
360
  ```
347
361
 
362
+ - **Rich Interactive Mode** - Run with the interactive Rich UI:
363
+ ```bash
364
+ python -m crackerjack --rich-ui
365
+ ```
366
+
348
367
  - **AI Integration** - Run with structured output for AI tools:
349
368
  ```bash
350
369
  python -m crackerjack --ai-agent --test
@@ -371,6 +390,79 @@ python -m crackerjack --ai-agent --test
371
390
 
372
391
  For detailed information about using Crackerjack with AI agents, including the structured output format and programmatic usage, see [README-AI-AGENT.md](README-AI-AGENT.md).
373
392
 
393
+ ## Interactive Rich UI
394
+
395
+ Crackerjack now offers an enhanced interactive experience through its Rich UI:
396
+
397
+ - **Visual Workflow:** See a visual representation of the entire task workflow with dependencies
398
+ - **Real-time Progress:** Track task progress with interactive progress bars and status indicators
399
+ - **Task Management:** Confirm tasks before execution and view detailed status information
400
+ - **Error Visualization:** Errors are presented in a structured, easy-to-understand format with recovery suggestions
401
+ - **File Selection:** Interactive file browser for operations that require selecting files
402
+
403
+ To use the Rich UI, run Crackerjack with the `--rich-ui` flag:
404
+
405
+ ```bash
406
+ python -m crackerjack --rich-ui
407
+ ```
408
+
409
+ This launches an interactive terminal interface where you can:
410
+ 1. View all available tasks and their dependencies
411
+ 2. Confirm each task before execution
412
+ 3. Get detailed status information for running tasks
413
+ 4. See a summary of completed, failed, and skipped tasks
414
+ 5. Visualize error details with recovery suggestions
415
+
416
+ ## Structured Error Handling
417
+
418
+ Crackerjack implements a comprehensive error handling system that provides:
419
+
420
+ - **Error Categories:** Errors are categorized by type (configuration, execution, testing, etc.)
421
+ - **Error Codes:** Each error has a unique numeric code for easy reference
422
+ - **Detailed Messages:** Clear, descriptive messages explain what went wrong
423
+ - **Recovery Suggestions:** Where possible, errors include recovery suggestions to help resolve issues
424
+ - **Rich Formatting:** Errors are presented with clear visual formatting (when using Rich UI or verbose mode)
425
+
426
+ Error types include:
427
+ - Configuration errors (1000-1999)
428
+ - Execution errors (2000-2999)
429
+ - Test errors (3000-3999)
430
+ - Publishing errors (4000-4999)
431
+ - Git errors (5000-5999)
432
+ - File operation errors (6000-6999)
433
+ - Code cleaning errors (7000-7999)
434
+ - Generic errors (9000-9999)
435
+
436
+ Use the `-v` or `--verbose` flag to see more detailed error information:
437
+
438
+ ```bash
439
+ python -m crackerjack -v
440
+ ```
441
+
442
+ For the most comprehensive error details with visual formatting, combine verbose mode with the Rich UI:
443
+
444
+ ```bash
445
+ python -m crackerjack --rich-ui -v
446
+ ```
447
+
448
+ ## Python 3.13+ Features
449
+
450
+ Crackerjack is designed to leverage the latest Python 3.13+ language features:
451
+
452
+ - **Type Parameter Syntax (PEP 695):** Uses the new, more concise syntax for generic type parameters
453
+ - **Self Type:** Leverages the `Self` type for better method chaining and builder patterns
454
+ - **Structural Pattern Matching:** Uses pattern matching for cleaner code, especially in configuration and command processing
455
+ - **Enhanced Type Hints:** More precise type hints with union types using the pipe operator
456
+ - **Modern Dictionary Patterns:** Leverages structural pattern matching with dictionaries for cleaner data handling
457
+
458
+ These modern Python features contribute to:
459
+ - More readable and maintainable code
460
+ - Better static type checking with tools like pyright
461
+ - Cleaner, more concise implementations
462
+ - Enhanced error handling and pattern recognition
463
+
464
+ Crackerjack provides examples of these features in action, serving as a reference for modern Python development practices.
465
+
374
466
  ## Contributing
375
467
 
376
468
  Crackerjack is an evolving project. Contributions are welcome! Please open a pull request or issue.
@@ -12,3 +12,5 @@
12
12
  /*.pyc
13
13
  /scratch/
14
14
  /.zencoder/
15
+
16
+ **/.claude/settings.local.json
@@ -34,7 +34,7 @@ repos:
34
34
  - keyring
35
35
 
36
36
  - repo: https://github.com/astral-sh/uv-pre-commit
37
- rev: 0.7.10
37
+ rev: 0.7.12
38
38
  hooks:
39
39
  - id: uv-lock
40
40
  files: ^pyproject\.toml$
@@ -55,7 +55,7 @@ repos:
55
55
  - tomli
56
56
 
57
57
  - repo: https://github.com/astral-sh/ruff-pre-commit
58
- rev: v0.11.12
58
+ rev: v0.11.13
59
59
  hooks:
60
60
  - id: ruff-check
61
61
  - id: ruff-format
@@ -0,0 +1,42 @@
1
+ import typing as t
2
+
3
+ from .crackerjack import Crackerjack, create_crackerjack_runner
4
+ from .errors import (
5
+ CleaningError,
6
+ ConfigError,
7
+ CrackerjackError,
8
+ ErrorCode,
9
+ ExecutionError,
10
+ FileError,
11
+ GitError,
12
+ PublishError,
13
+ TestError,
14
+ check_command_result,
15
+ check_file_exists,
16
+ handle_error,
17
+ )
18
+
19
+ try:
20
+ from importlib.metadata import version
21
+
22
+ __version__ = version("crackerjack")
23
+ except (ImportError, ModuleNotFoundError):
24
+ __version__ = "0.19.8"
25
+
26
+ __all__: t.Sequence[str] = [
27
+ "create_crackerjack_runner",
28
+ "Crackerjack",
29
+ "__version__",
30
+ "CrackerjackError",
31
+ "ConfigError",
32
+ "ExecutionError",
33
+ "TestError",
34
+ "PublishError",
35
+ "GitError",
36
+ "FileError",
37
+ "CleaningError",
38
+ "ErrorCode",
39
+ "handle_error",
40
+ "check_file_exists",
41
+ "check_command_result",
42
+ ]
@@ -34,10 +34,13 @@ class Options(BaseModel):
34
34
  benchmark: bool = False
35
35
  benchmark_regression: bool = False
36
36
  benchmark_regression_threshold: float = 5.0
37
+ test_workers: int = 0
38
+ test_timeout: int = 0
37
39
  all: BumpOption | None = None
38
40
  ai_agent: bool = False
39
41
  create_pr: bool = False
40
42
  skip_hooks: bool = False
43
+ rich_ui: bool = False
41
44
 
42
45
  @classmethod
43
46
  @field_validator("publish", "bump", mode="before")
@@ -84,7 +87,7 @@ cli_options = {
84
87
  False,
85
88
  "-x",
86
89
  "--clean",
87
- help="Remove docstrings, line comments, and unnecessary whitespace.",
90
+ help="Remove docstrings, line comments, and unnecessary whitespace from source code (doesn't affect test files).",
88
91
  ),
89
92
  "test": typer.Option(False, "-t", "--test", help="Run tests."),
90
93
  "benchmark": typer.Option(
@@ -102,6 +105,16 @@ cli_options = {
102
105
  "--benchmark-regression-threshold",
103
106
  help="Maximum allowed performance regression percentage (default: 5.0%).",
104
107
  ),
108
+ "test_workers": typer.Option(
109
+ 0,
110
+ "--test-workers",
111
+ help="Number of parallel workers for running tests (0 = auto-detect, 1 = disable parallelization).",
112
+ ),
113
+ "test_timeout": typer.Option(
114
+ 0,
115
+ "--test-timeout",
116
+ help="Timeout in seconds for individual tests (0 = use default based on project size).",
117
+ ),
105
118
  "skip_hooks": typer.Option(
106
119
  False,
107
120
  "-s",
@@ -121,6 +134,11 @@ cli_options = {
121
134
  "--pr",
122
135
  help="Create a pull request to the upstream repository.",
123
136
  ),
137
+ "rich_ui": typer.Option(
138
+ False,
139
+ "--rich-ui",
140
+ help="Use the interactive Rich UI for a better experience.",
141
+ ),
124
142
  "ai_agent": typer.Option(
125
143
  False,
126
144
  "--ai-agent",
@@ -148,8 +166,11 @@ def main(
148
166
  benchmark_regression_threshold: float = cli_options[
149
167
  "benchmark_regression_threshold"
150
168
  ],
169
+ test_workers: int = cli_options["test_workers"],
170
+ test_timeout: int = cli_options["test_timeout"],
151
171
  skip_hooks: bool = cli_options["skip_hooks"],
152
172
  create_pr: bool = cli_options["create_pr"],
173
+ rich_ui: bool = cli_options["rich_ui"],
153
174
  ai_agent: bool = cli_options["ai_agent"],
154
175
  ) -> None:
155
176
  options = Options(
@@ -166,10 +187,13 @@ def main(
166
187
  benchmark=benchmark,
167
188
  benchmark_regression=benchmark_regression,
168
189
  benchmark_regression_threshold=benchmark_regression_threshold,
190
+ test_workers=test_workers,
191
+ test_timeout=test_timeout,
169
192
  skip_hooks=skip_hooks,
170
193
  all=all,
171
194
  ai_agent=ai_agent,
172
195
  create_pr=create_pr,
196
+ rich_ui=rich_ui,
173
197
  )
174
198
 
175
199
  if ai_agent:
@@ -177,8 +201,20 @@ def main(
177
201
 
178
202
  os.environ["AI_AGENT"] = "1"
179
203
 
180
- runner = create_crackerjack_runner(console=console)
181
- runner.process(options)
204
+ if rich_ui:
205
+ from crackerjack.interactive import launch_interactive_cli
206
+
207
+ try:
208
+ from importlib.metadata import version
209
+
210
+ pkg_version = version("crackerjack")
211
+ except (ImportError, ModuleNotFoundError):
212
+ pkg_version = "0.19.8"
213
+
214
+ launch_interactive_cli(pkg_version)
215
+ else:
216
+ runner = create_crackerjack_runner(console=console)
217
+ runner.process(options)
182
218
 
183
219
 
184
220
  if __name__ == "__main__":