Enable mypy strict-optional and fix nullability gaps (closes #69)#79
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughRemoves mypy's ChangesStrict-Optional Type Safety Enablement
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Must fixservices/workspace_resolver.py:97 - guard or narrow row before indexing it. (python -m mypy . fails with Value of type "tuple[Any, ...] | None" is not indexable [index]; this file was not changed, but enabling strict optional makes it a PR-blocking acceptance-criteria failure.) |
Summary
--no-strict-optionalfrompyproject.tomland CI so mypy enforces null checks onOptionalvalues (strict-optional is mypy's default).dict.get()can returnNone:services/workspace_tabs.py: skip headers with missing/non-strbubbleId; narrowmodelsUsedwithisinstance(..., list)before membership/insert.services/workspace_listing.py: only pass validatedstrbubble IDs intobubble_map.get()when checkinghas_bubbles.tests/test_workspace_tabs_malformed_nested.pyafterassertIsNotNone.No runtime behavior change — annotations and guard clauses only. Addresses the eval Test 6 finding (
mypy --no-strict-optionalmasking Optional misuse at pipeline parse sites).Test plan
mypy --ignore-missing-imports --pretty .— clean (67 files)pytest— all tests passSummary by CodeRabbit
Chores
Refactor
Tests