crackerjack 0.24.8__tar.gz → 0.24.9__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.24.8 → crackerjack-0.24.9}/CLAUDE.md +88 -5
- {crackerjack-0.24.8 → crackerjack-0.24.9}/PKG-INFO +1 -1
- {crackerjack-0.24.8/crackerjack → crackerjack-0.24.9}/pyproject.toml +1 -1
- {crackerjack-0.24.8 → crackerjack-0.24.9}/uv.lock +1 -1
- {crackerjack-0.24.8 → crackerjack-0.24.9}/.envrc +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/.github/FUNDING.yml +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/.gitignore +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/.libcst.codemod.yaml +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/.pre-commit-config-ai.yaml +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/.pre-commit-config.yaml +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/.windsurfrules +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/LICENSE +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/README-AI-AGENT.md +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/README.md +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/RULES.md +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/crackerjack/.gitignore +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/crackerjack/.libcst.codemod.yaml +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/crackerjack/.pdm.toml +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/crackerjack/.pre-commit-config-ai.yaml +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/crackerjack/.pre-commit-config.yaml +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/crackerjack/__init__.py +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/crackerjack/__main__.py +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/crackerjack/crackerjack.py +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/crackerjack/errors.py +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/crackerjack/interactive.py +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/crackerjack/py313.py +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9/crackerjack}/pyproject.toml +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/tests/TESTING.md +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/tests/__init__.py +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/tests/conftest.py +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/tests/data/comments_sample.txt +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/tests/data/docstrings_sample.txt +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/tests/data/expected_comments_sample.txt +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/tests/data/init.py +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/tests/test_crackerjack.py +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/tests/test_crackerjack_runner.py +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/tests/test_errors.py +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/tests/test_interactive.py +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/tests/test_interactive_run.py +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/tests/test_main.py +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/tests/test_multiline_functions.py +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/tests/test_py313_advanced.py +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/tests/test_py313_features.py +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/tests/test_pytest_features.py +0 -0
- {crackerjack-0.24.8 → crackerjack-0.24.9}/tests/test_structured_errors.py +0 -0
|
@@ -219,10 +219,11 @@ Access interactive mode with: `python -m crackerjack -i`
|
|
|
219
219
|
## Development Guidelines
|
|
220
220
|
|
|
221
221
|
1. **Code Style**: Follow the Crackerjack style guide:
|
|
222
|
-
- Use
|
|
222
|
+
- **Target Python 3.13+** - Use latest Python features
|
|
223
|
+
- Use static typing throughout with modern syntax
|
|
223
224
|
- Use pathlib for file operations
|
|
224
225
|
- Prefer Protocol over ABC
|
|
225
|
-
-
|
|
226
|
+
- Leverage Python 3.13+ performance and language improvements
|
|
226
227
|
|
|
227
228
|
2. **Testing Approach**:
|
|
228
229
|
- Write unit tests for all functionality
|
|
@@ -234,7 +235,12 @@ Access interactive mode with: `python -m crackerjack -i`
|
|
|
234
235
|
- Ruff for linting and formatting
|
|
235
236
|
- Pytest for testing
|
|
236
237
|
|
|
237
|
-
4. **Version
|
|
238
|
+
4. **Python Version**:
|
|
239
|
+
- **Target: Python 3.13+** - Crackerjack requires Python 3.13 or newer
|
|
240
|
+
- Use modern Python 3.13+ features and syntax
|
|
241
|
+
- Code must be compatible with Python 3.13+ only
|
|
242
|
+
|
|
243
|
+
5. **Version Management**:
|
|
238
244
|
- Version bumping is handled through UV
|
|
239
245
|
- Follows semantic versioning
|
|
240
246
|
|
|
@@ -242,7 +248,9 @@ Access interactive mode with: `python -m crackerjack -i`
|
|
|
242
248
|
|
|
243
249
|
When generating code, AI assistants MUST follow these standards to ensure compliance with Refurb and Bandit pre-commit hooks:
|
|
244
250
|
|
|
245
|
-
|
|
251
|
+
**IMPORTANT: Target Python 3.13+** - All code must be compatible with Python 3.13 or newer. Use the latest Python features and syntax.
|
|
252
|
+
|
|
253
|
+
### Refurb Standards (Modern Python Patterns up to 3.12)
|
|
246
254
|
|
|
247
255
|
**Use modern syntax and built-ins:**
|
|
248
256
|
- Use `pathlib.Path` instead of `os.path` operations
|
|
@@ -275,7 +283,7 @@ if config_file.exists():
|
|
|
275
283
|
if name.startswith("test_"):
|
|
276
284
|
name = name.removeprefix("test_")
|
|
277
285
|
|
|
278
|
-
# Good: Union types (Python 3.
|
|
286
|
+
# Good: Union types (Python 3.13+)
|
|
279
287
|
def process_data(data: str | bytes) -> dict[str, Any]:
|
|
280
288
|
pass
|
|
281
289
|
|
|
@@ -335,6 +343,81 @@ if not api_key:
|
|
|
335
343
|
cursor.execute("SELECT * FROM users WHERE id = %s", (user_id,))
|
|
336
344
|
```
|
|
337
345
|
|
|
346
|
+
### Pyright Type Safety Standards
|
|
347
|
+
|
|
348
|
+
**Always use explicit type annotations:**
|
|
349
|
+
- Function parameters must have type hints
|
|
350
|
+
- Function return types must be annotated
|
|
351
|
+
- Class attributes should have type annotations
|
|
352
|
+
- Use `from __future__ import annotations` for forward references
|
|
353
|
+
|
|
354
|
+
**Handle Optional types properly:**
|
|
355
|
+
- Use `str | None` instead of `Optional[str]` (required for Python 3.13+)
|
|
356
|
+
- Always check for None before using optional values
|
|
357
|
+
- Use explicit `assert` statements or type guards when narrowing types
|
|
358
|
+
|
|
359
|
+
**Generic types and collections:**
|
|
360
|
+
- Use `list[str]` instead of `List[str]` (required for Python 3.13+)
|
|
361
|
+
- Use `dict[str, Any]` instead of `Dict[str, Any]` (required for Python 3.13+)
|
|
362
|
+
- Properly type generic classes with `TypeVar` when needed
|
|
363
|
+
- Use `Sequence` or `Iterable` for function parameters when appropriate
|
|
364
|
+
|
|
365
|
+
**Protocol and ABC usage:**
|
|
366
|
+
- Prefer `typing.Protocol` over abstract base classes for duck typing
|
|
367
|
+
- Use `@runtime_checkable` when protocols need runtime checks
|
|
368
|
+
- Define clear interfaces with protocols
|
|
369
|
+
|
|
370
|
+
**Python 3.13+ specific features:**
|
|
371
|
+
- Leverage improved error messages and performance optimizations
|
|
372
|
+
- Use enhanced type system features available in 3.13+
|
|
373
|
+
- Take advantage of improved pathlib and asyncio features
|
|
374
|
+
- Use any new syntax or standard library improvements
|
|
375
|
+
|
|
376
|
+
**Import and module organization:**
|
|
377
|
+
- Import types in TYPE_CHECKING blocks when needed for forward references
|
|
378
|
+
- Use proper module-level `__all__` declarations
|
|
379
|
+
- Organize imports: standard library, third-party, local imports
|
|
380
|
+
|
|
381
|
+
**Example of proper typing:**
|
|
382
|
+
```python
|
|
383
|
+
from __future__ import annotations
|
|
384
|
+
|
|
385
|
+
from typing import TYPE_CHECKING, Protocol, runtime_checkable
|
|
386
|
+
from pathlib import Path
|
|
387
|
+
|
|
388
|
+
if TYPE_CHECKING:
|
|
389
|
+
from collections.abc import Sequence
|
|
390
|
+
|
|
391
|
+
@runtime_checkable
|
|
392
|
+
class Writable(Protocol):
|
|
393
|
+
def write(self, data: str) -> None: ...
|
|
394
|
+
|
|
395
|
+
def process_files(
|
|
396
|
+
paths: Sequence[Path],
|
|
397
|
+
output: Writable,
|
|
398
|
+
encoding: str = "utf-8",
|
|
399
|
+
) -> dict[str, int]:
|
|
400
|
+
"""Process files and return statistics."""
|
|
401
|
+
stats: dict[str, int] = {}
|
|
402
|
+
|
|
403
|
+
for path in paths:
|
|
404
|
+
if path.exists():
|
|
405
|
+
content = path.read_text(encoding=encoding)
|
|
406
|
+
stats[str(path)] = len(content)
|
|
407
|
+
output.write(f"Processed {path}\n")
|
|
408
|
+
|
|
409
|
+
return stats
|
|
410
|
+
|
|
411
|
+
# Good: Type narrowing with assertion
|
|
412
|
+
def validate_config(config: dict[str, str | None]) -> dict[str, str]:
|
|
413
|
+
"""Validate that all config values are non-None."""
|
|
414
|
+
validated: dict[str, str] = {}
|
|
415
|
+
for key, value in config.items():
|
|
416
|
+
assert value is not None, f"Config key {key} cannot be None"
|
|
417
|
+
validated[key] = value
|
|
418
|
+
return validated
|
|
419
|
+
```
|
|
420
|
+
|
|
338
421
|
### Integration with Pre-commit Hooks
|
|
339
422
|
|
|
340
423
|
These standards align with the project's pre-commit hooks:
|
|
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
|
|
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
|