Splitting unknown-name error code#2584
Conversation
This comment has been minimized.
This comment has been minimized.
yangdanny97
left a comment
There was a problem hiding this comment.
In the comments of the original issue @rchen152 mentioned we can just use a single new error kind for this, rather than two.
Let's rename it UnimportedDirective since the typing spec calls assert_type/reveal_type/cast directives: https://typing.python.org/en/latest/spec/directives.html#type-checker-directives
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
c11a818 to
fb0f123
Compare
|
Diff from mypy_primer, showing the effect of this PR on open source code: cloud-init (https://github.com/canonical/cloud-init)
- ERROR cloudinit/config/cc_ca_certs.py:118:44-120:6: No matching overload found for function `posixpath.join` called with arguments: (list[str] | str | Unknown | None, list[str] | str | Unknown | None) [no-matching-overload]
+ ERROR cloudinit/config/cc_ca_certs.py:118:44-120:6: No matching overload found for function `posixpath.join` called with arguments: (list[str] | str | None, list[str] | str | None) [no-matching-overload]
hydra-zen (https://github.com/mit-ll-responsible-ai/hydra-zen)
- ERROR tests/annotations/behaviors.py:73:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/behaviors.py:73:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/behaviors.py:84:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/behaviors.py:84:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:79:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:79:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:84:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:84:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:89:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:89:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:90:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:90:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:97:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:97:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:104:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:104:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:110:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:110:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:111:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:111:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:112:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:112:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:117:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:117:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:119:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:119:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:121:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:121:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:125:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:125:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:130:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:130:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:132:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:132:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:134:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:134:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:136:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:136:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:138:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:138:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:140:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:140:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:150:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:150:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:151:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:151:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:152:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:152:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:153:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:153:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:155:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:155:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:156:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:156:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:157:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:157:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:158:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:158:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:159:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:159:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:160:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:160:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:161:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:161:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:162:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:162:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:163:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:163:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:166:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:166:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:167:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:167:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:173:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:173:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:174:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:174:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:175:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:175:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:186:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:186:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:187:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:187:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:192:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:192:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:193:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:193:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:194:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:194:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:195:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:195:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:198:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:198:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:199:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:199:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:202:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:202:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:205:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:205:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:207:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:207:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:208:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:208:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:209:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:209:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:210:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:210:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:218:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:218:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:228:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:228:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:229:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:229:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:230:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:230:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:231:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:231:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:232:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:232:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:236:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:236:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:241:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:241:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:245:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:245:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:249:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:249:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:253:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:253:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:257:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:257:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:261:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:261:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:274:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:274:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:275:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:275:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:299:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:299:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:325:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:325:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:336:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:336:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:348:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:348:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:433:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:433:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:436:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:436:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:456:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:456:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:477:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:477:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:478:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:478:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:483:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:483:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:486:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:486:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:505:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:505:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:506:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:506:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:510:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:510:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:511:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:511:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:513:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:513:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:514:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:514:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:516:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:516:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:517:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:517:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:520:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:520:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:521:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:521:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:524:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:524:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:554:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:554:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:558:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:558:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
- ERROR tests/annotations/declarations.py:562:5-16: `reveal_type` must be imported from `typing` for runtime usage [unknown-name]
+ ERROR tests/annotations/declarations.py:562:5-16: `reveal_type` must be imported from `typing` for runtime usage [unimported-directive]
... (truncated 180 lines) ...
|
Primer Diff Classification➖ 2 neutral | 2 project(s) total
Detailed analysis➖ Neutral (2)cloud-init (+1, -1)
hydra-zen (+183, -183)
Was this helpful? React with 👍 or 👎 Classification by primer-classifier (1 heuristic, 1 LLM) |
|
can you review the changes |
|
@yangdanny97 has imported this pull request. If you are a Meta employee, you can view this in D94923965. |
kinto0
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
Summary
This PR adds two new error kinds,
UnimportedAssertTypeandUnimportedRevealType, to make error reporting more specific whenassert_typeorreveal_typeare used without being imported. Instead of falling back to the genericunknown-nameerror, the binding logic now emits these dedicated error types. Both were added to theErrorKindenum with a default severity ofError. I also updated the documentation to describe the new error kinds and adjusted the relevant test expectations to match the new diagnostics, while keeping the existing Rust unit tests unchanged to ensure everything still aligns with the intended error behavior.Fixes #2550
Test Plan
I verified that
cargo test test_assert_type_variationsandcargo test test_reveal_type_variationsboth run and pass after the changes. I also made sure the new configuration values are properly sorted and parsed as expected by the existing framework. With this update, users can now suppress these specific diagnostics using# pyrefly: ignore[unimported-reveal-type](or the corresponding assert type rule) without having to ignore allunknown-nameerrors, which keeps suppression more precise and intentional.