ruff/crates
Connor Skees 3e702e12f7
red-knot: support narrowing for bool(E) (#14668)
Resolves https://github.com/astral-sh/ruff/issues/14547 by delegating
narrowing to `E` for `bool(E)` where `E` is some expression.

This change does not include other builtin class constructors which
should also work in this position, like `int(..)` or `float(..)`, as the
original issue does not mention these. It should be easy enough to add
checks for these as well if we want to.

I don't see a lot of markdown tests for malformed input, maybe there's a
better place for the no args and too many args cases to go?

I did see after the fact that it looks like this task was intended for a
new hire.. my apologies. I got here from
https://github.com/astral-sh/ruff/issues/13694, which is marked
help-wanted.

---------

Co-authored-by: David Peter <mail@david-peter.de>
2024-12-03 03:04:59 +00:00
..
red_knot Update pre-commit dependencies (#14719) 2024-12-02 06:02:56 +00:00
red_knot_python_semantic red-knot: support narrowing for bool(E) (#14668) 2024-12-03 03:04:59 +00:00
red_knot_server Upgrade Rust toolchain to 1.83 (#14677) 2024-11-29 12:05:05 +00:00
red_knot_test mdtest: include test name in printed rerun command (#14684) 2024-11-30 11:01:06 +00:00
red_knot_vendored Sync vendored typeshed stubs (#14696) 2024-12-01 01:38:31 +00:00
red_knot_wasm Add tests for python version compatibility (#14430) 2024-11-18 12:26:55 +00:00
red_knot_workspace [red-knot] Re-enable linter corpus tests (#14736) 2024-12-02 20:11:30 +01:00
ruff Bump version to 0.8.1 (#14655) 2024-11-28 19:12:50 +05:30
ruff_benchmark Fix Red Knot benchmarks on Windows (#14400) 2024-11-17 16:21:09 +00:00
ruff_cache Fix cache key collisions for paths with separators (#12159) 2024-07-03 07:36:46 -05:00
ruff_db Upgrade Rust toolchain to 1.83 (#14677) 2024-11-29 12:05:05 +00:00
ruff_dev Alternate quotes for strings inside f-strings in preview (#13860) 2024-10-23 07:57:53 +02:00
ruff_diagnostics Upgrade Rust toolchain to 1.83 (#14677) 2024-11-29 12:05:05 +00:00
ruff_formatter Upgrade Rust toolchain to 1.83 (#14677) 2024-11-29 12:05:05 +00:00
ruff_graph Bump MSRV to Rust 1.80 (#13826) 2024-10-20 10:55:36 +02:00
ruff_index [red-knot] small efficiency improvements and bugfixes to use-def map building (#12373) 2024-07-18 09:24:58 -07:00
ruff_linter [refurb] Handle non-finite decimals in verbose-decimal-constructor (FURB157) (#14596) 2024-12-02 18:13:20 -06:00
ruff_macros Use a derive macro for Violations (#14557) 2024-11-27 09:41:40 +00:00
ruff_notebook Bump MSRV to Rust 1.80 (#13826) 2024-10-20 10:55:36 +02:00
ruff_python_ast Upgrade Rust toolchain to 1.83 (#14677) 2024-11-29 12:05:05 +00:00
ruff_python_ast_integration_tests Update insta snapshots (#14366) 2024-11-15 19:31:15 +01:00
ruff_python_codegen Extract LineIndex independent methods from Locator (#13938) 2024-10-28 07:53:41 +00:00
ruff_python_formatter Update pre-commit dependencies (#14719) 2024-12-02 06:02:56 +00:00
ruff_python_index Extract LineIndex independent methods from Locator (#13938) 2024-10-28 07:53:41 +00:00
ruff_python_literal Upgrade Rust toolchain to 1.83 (#14677) 2024-11-29 12:05:05 +00:00
ruff_python_parser Upgrade Rust toolchain to 1.83 (#14677) 2024-11-29 12:05:05 +00:00
ruff_python_resolver Update insta snapshots (#14366) 2024-11-15 19:31:15 +01:00
ruff_python_semantic Revert: [pyflakes] Avoid false positives in @no_type_check contexts (F821, F722) (#14615) (#14726) 2024-12-02 14:28:27 +01:00
ruff_python_stdlib Refactor crates/ruff_python_stdlib/src/builtins.rs to make it easier to add support for new Python versions (#14632) 2024-11-27 12:20:21 +00:00
ruff_python_trivia Extract LineIndex independent methods from Locator (#13938) 2024-10-28 07:53:41 +00:00
ruff_python_trivia_integration_tests Update insta snapshots (#14366) 2024-11-15 19:31:15 +01:00
ruff_server Upgrade Rust toolchain to 1.83 (#14677) 2024-11-29 12:05:05 +00:00
ruff_source_file Extract LineIndex independent methods from Locator (#13938) 2024-10-28 07:53:41 +00:00
ruff_text_size Extract LineIndex independent methods from Locator (#13938) 2024-10-28 07:53:41 +00:00
ruff_wasm Bump version to 0.8.1 (#14655) 2024-11-28 19:12:50 +05:30
ruff_workspace Upgrade Rust toolchain to 1.83 (#14677) 2024-11-29 12:05:05 +00:00