Added initial typehints - #494
Merged
Merged
Claude / Claude Code Review
completed
May 8, 2026 in 25m 3s
Code review found 1 important issue
Found 5 candidates, confirmed 3. See review comments for details.
Details
| Severity | Count |
|---|---|
| 🔴 Important | 1 |
| 🟡 Nit | 1 |
| 🟣 Pre-existing | 0 |
| Severity | File:Line | Issue |
|---|---|---|
| 🔴 Important | pyproject.toml:55-68 |
Missing typing_extensions runtime dependency breaks Python 3.9/3.10 import |
| 🟡 Nit | rollbar/__init__.py:256 |
BASE_DATA_HOOK return type contradicts every hook implementation |
Annotations
Check failure on line 68 in pyproject.toml
claude / Claude Code Review
Missing typing_extensions runtime dependency breaks Python 3.9/3.10 import
On a clean Python 3.9 or 3.10 install, `import rollbar` fails with `ModuleNotFoundError: No module named 'typing_extensions'` because `rollbar/__init__.py:25-31` (Unpack) and `rollbar/lib/traverse.py:8-12` (ParamSpec) fall back to `typing_extensions` for symbols not yet in the stdlib (Unpack is 3.11+, ParamSpec is 3.10+), but pyproject.toml only declares `requests>=0.12.1` as a runtime dependency. CI hides this because the new `type` group transitively pulls `typing_extensions` via mypy and `tes
Check warning on line 256 in rollbar/__init__.py
claude / Claude Code Review
BASE_DATA_HOOK return type contradicts every hook implementation
The `BASE_DATA_HOOK` annotation at rollbar/__init__.py:256 declares `Callable[[Any, dict[str, Any]], dict[str, Any]] | None` (must return dict), but every hook implementation in this codebase mutates `data` in place and returns `None` implicitly (rollbar/contrib/{pyramid,bottle,django,asgi,flask,quart}/...). The caller at rollbar/__init__.py:1120-1121 also discards the return value, confirming the contract is mutate-in-place; suggest changing the annotation to `Callable[[Any, dict[str, Any]], No
Loading