refactor: tighten checked-source typing coverage - #611
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
38dbb0c to
e6eeb2e
Compare
c7fbb20 to
eceb66e
Compare
e6eeb2e to
11831fb
Compare
eceb66e to
46af38a
Compare
11831fb to
fcfa4e4
Compare
46af38a to
0c08cb9
Compare
fcfa4e4 to
abe772d
Compare
8d3f148 to
9af5f17
Compare
4279303 to
9fb2209
Compare
cf5ea01 to
3f2bc65
Compare
9fb2209 to
7b0bc4d
Compare
7b0bc4d to
dde3d14
Compare
967deb4 to
a9286fc
Compare
1f04697 to
12d893a
Compare
a9286fc to
0e72757
Compare
Greptile SummaryThis PR enables the
Confidence Score: 5/5All changes are type-annotation tightening with no logic changes outside the The diff is a mechanical refactoring: No files require special attention beyond the distance-type annotation in Important Files Changed
|
| def _auto_map_class_refs(value: AutoMapValue) -> list[str]: | ||
| match value: | ||
| case str() as class_ref: | ||
| return [class_ref] | ||
| case list() as class_refs: | ||
| return [item for item in class_refs if isinstance(item, str)] |
There was a problem hiding this comment.
Missing implicit fallthrough in
_auto_map_class_refs
The old implementation had an explicit return [] for any non-str/non-list value. The refactored match statement covers str() and list() — which are exhaustive over AutoMapValue = str | list[object] — but has no case _: arm. If the function is ever called with a value that slips past the type alias (e.g., from untyped dynamic code), Python silently returns None instead of [], violating the declared -> list[str] return type. Adding case _: return [] restores the original defensive behaviour at zero cost.
0e72757 to
3d5719d
Compare
a7f61aa to
756d95c
Compare
3d5719d to
756d95c
Compare
Summary
Test plan
Related issue: #614