-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[red-knot] Silence unresolved-import in unreachable code
#17336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5ebe9a0 to
77da466
Compare
unresolved-import in unreachable code
Contributor
|
77da466 to
537149f
Compare
sharkdp
commented
Apr 10, 2025
carljm
approved these changes
Apr 10, 2025
AlexWaygood
approved these changes
Apr 10, 2025
537149f to
c3a1b05
Compare
dcreager
added a commit
that referenced
this pull request
Apr 10, 2025
* main: (30 commits) [red-knot] Silence `unresolved-import` in unreachable code (#17336) red_knot_python_semantic: move TODO comment red_knot_python_semantic: rename `lint()` and `report()` ruff_db: use `Annotation::get_message` in more places red_knot_python_semantic: tweak docs on building reporter builders red_knot_python_semantic: remove the "old" secondary message type red_knot_python_semantic: replace one use of "old" secondary diagnostic messages red_knot_python_semantic: update revealed type snapshots ruff_db: tweak how the revealed type diagnostic is rendered red_knot: add explicit test for concise `reveal_type` diagnostic red_knot_python_semantic: remove `InferContext::report_diagnostic` red_knot_python_semantic: add "reporter" API Bump 0.11.5 (#17337) [red-knot] Silence `unresolved-attribute` in unreachable code (#17305) Revert "[red-knot] Type narrowing for assertions (#17149)" (#17335) [red-knot] Type narrowing for assertions (#17149) [red-knot] avoid unnecessary evaluation of visibility constraint on definitely-unbound symbol (#17326) update cargo-dist (#17325) [red-knot] Fix double hovers/inlays in playground (#17334) [red-knot] Track reachability of scopes (#17332) ...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Similar to what we did for
unresolved-referenceandunresolved-attribute, we now also silenceunresolved-importdiagnostics if the correspondingimportstatement is unreachable.This addresses the (already closed) issue #17049.
Test Plan
Adapted Markdown tests.