-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[red-knot] Default python-platform
to current platform
#17183
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
Conversation
|
eb8cf65
to
bae0525
Compare
Funny, this looks worse when just looking at mypy primer. Would @sharkdp's other unreachable work help to address some of those warnings? |
Yes, it definitely will. You're mostly just turning "possibly unbound" diagnostics into "definitely unbound" diagnostics (which are now in unreachable sections of code, which is what we want from this change). Silencing these "definitely unbound" errors inside unreachable sections remains an open topic that I am still working on, even after that first batch of problems has been solved. If we want to see the effect of this change in isolation, we should consider waiting with this PR until I have fixed that. |
bae0525
to
52f71fa
Compare
52f71fa
to
cc655ea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
I have analyzed all ecosystem diagnostic changes and added new test cases for those that we don't handle properly yet (#17306). Merging this will help me analyze the upcoming changes around unreachable-code diagnostics in a better way.
* origin/main: [red-knot] Default `python-platform` to current platform (#17183) [red-knot] Add new 'unreachable code' test case (#17306) [red-knot] mypy_primer: Run on `async-utils` (#17303) [red-knot] Add custom `__setattr__` support (#16748) [red-knot] Add `__init__` arguments check when doing `try_call` on a class literal (#16512) [`flake8-pie`] Avoid false positive for multiple assignment with `auto()` (`PIE796`) (#17274) [syntax-errors] Async comprehension in sync comprehension (#17177) [`airflow`] Expand module path check to individual symbols (`AIR302`) (#17278) [syntax-errors] Check annotations in annotated assignments (#17283) [syntax-errors] Extend annotation checks to `await` (#17282) [red-knot] Add support for `assert_never` (#17287) [`flake8-pytest-style`] Avoid false positive for legacy form of `pytest.raises` (`PT011`) (#17231) [red-knot] Do not show types for literal expressions on hover (#17290) [red-knot] Fix dead-code clippy warning (#17291) [red-knot] Reachability analysis (#17199) [red-knot] Don't use latency-sensitive for handlers (#17227)
* dcreager/special-class: (26 commits) lint Add TODO about property test data Better todos Narrow type(generic) better More Python-like displays for specializations Add xfail for generic method inside generic class Comment other non-specializations Explain self_instance not being specialized Generic aliases are literals in type display Better TODO fallback type [red-knot] Default `python-platform` to current platform (#17183) [red-knot] Add new 'unreachable code' test case (#17306) [red-knot] mypy_primer: Run on `async-utils` (#17303) [red-knot] Add custom `__setattr__` support (#16748) [red-knot] Add `__init__` arguments check when doing `try_call` on a class literal (#16512) [`flake8-pie`] Avoid false positive for multiple assignment with `auto()` (`PIE796`) (#17274) [syntax-errors] Async comprehension in sync comprehension (#17177) [`airflow`] Expand module path check to individual symbols (`AIR302`) (#17278) [syntax-errors] Check annotations in annotated assignments (#17283) [syntax-errors] Extend annotation checks to `await` (#17282) ...
…7183) ## Summary As discussed in https://github.com/astral-sh/ruff/issues/16983 and "mitigate" said issue for the alpha. This PR changes the default for `PythonPlatform` to be the current platform rather than `all`. I'm not sure if we should be as sophisticated as supporting `ios` and `android` as defaults but it was easy... ## Test Plan Updated Markdown tests. --------- Co-authored-by: David Peter <mail@david-peter.de>
Summary
As discussed in astral-sh/ty#160 and "mitigate" said issue for the alpha.
This PR changes the default for
PythonPlatform
to be the current platform rather thanall
.I'm not sure if we should be as sophisticated as supporting
ios
andandroid
as defaults but it was easy...Test Plan
Some mdtests started failing because they now defaulted to
darwin
.