mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-17 05:47:49 +00:00
![]()
Some checks are pending
CI / cargo build (msrv) (push) Blocked by required conditions
CI / Determine changes (push) Waiting to run
CI / cargo fmt (push) Waiting to run
CI / cargo clippy (push) Blocked by required conditions
CI / cargo test (linux) (push) Blocked by required conditions
CI / cargo test (linux, release) (push) Blocked by required conditions
CI / cargo test (windows) (push) Blocked by required conditions
CI / cargo test (wasm) (push) Blocked by required conditions
CI / cargo build (release) (push) Waiting to run
CI / cargo fuzz build (push) Blocked by required conditions
CI / fuzz parser (push) Blocked by required conditions
CI / test scripts (push) Blocked by required conditions
CI / ecosystem (push) Blocked by required conditions
CI / cargo shear (push) Blocked by required conditions
CI / python package (push) Waiting to run
CI / pre-commit (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / formatter instabilities and black similarity (push) Blocked by required conditions
CI / test ruff-lsp (push) Blocked by required conditions
CI / check playground (push) Blocked by required conditions
CI / benchmarks (push) Blocked by required conditions
[Knot Playground] Release / publish (push) Waiting to run
Summary -- Detect async comprehensions nested in sync comprehensions in async functions before Python 3.11, when this was [changed]. The actual logic of this rule is very straightforward, but properly tracking the async scopes took a bit of work. An alternative to the current approach is to offload the `in_async_context` check into the `SemanticSyntaxContext` trait, but that actually required much more extensive changes to the `TestContext` and also to ruff's semantic model, as you can see in the changes up to 31554b473507034735bd410760fde6341d54a050. This version has the benefit of mostly centralizing the state tracking in `SemanticSyntaxChecker`, although there was some subtlety around deferred function body traversal that made the changes to `Checker` more intrusive too (hence the new linter test). The `Checkpoint` struct/system is obviously overkill for now since it's only tracking a single `bool`, but I thought it might be more useful later. [changed]: https://github.com/python/cpython/issues/77527 Test Plan -- New inline tests and a new linter integration test. |
||
---|---|---|
.. | ||
all_async_comprehension_py310.py | ||
ambiguous_lpar_with_items_binary_expr.py | ||
ambiguous_lpar_with_items_if_expr.py | ||
ann_assign_stmt_simple_target.py | ||
args_unparenthesized_generator.py | ||
assign_targets_terminator.py | ||
async_for_statement.py | ||
async_function_definition.py | ||
async_with_statement.py | ||
class_def_arguments.py | ||
class_keyword_in_case_pattern.py | ||
class_type_params_py312.py | ||
comma_separated_regular_list_terminator.py | ||
debug_rename_import.py | ||
decorator_async_function.py | ||
decorator_await_expression_py39.py | ||
decorator_expression_dotted_ident_py38.py | ||
decorator_expression_eval_hack_py38.py | ||
decorator_expression_identity_hack_py38.py | ||
decorator_expression_py39.py | ||
del_debug_py38.py | ||
del_targets_terminator.py | ||
dotted_name_normalized_spaces.py | ||
duplicate_match_key_attr.py | ||
except_star_py311.py | ||
except_stmt_as_name_soft_keyword.py | ||
for_in_target_valid_expr.py | ||
for_iter_unpack_py38.py | ||
for_iter_unpack_py39.py | ||
from_import_no_space.py | ||
from_import_soft_keyword_module_name.py | ||
from_import_stmt_terminator.py | ||
fstring_format_spec_terminator.py | ||
function_def_parameter_range.py | ||
function_def_parenthesized_return_types.py | ||
function_def_valid_return_expr.py | ||
function_type_params_py312.py | ||
global_stmt.py | ||
import_as_name_soft_keyword.py | ||
import_stmt_terminator.py | ||
irrefutable_case_pattern_at_end.py | ||
iter_unpack_return_py37.py | ||
iter_unpack_return_py38.py | ||
iter_unpack_yield_py37.py | ||
iter_unpack_yield_py38.py | ||
lambda_with_no_parameters.py | ||
lambda_with_valid_body.py | ||
match_after_py310.py | ||
match_as_pattern.py | ||
match_as_pattern_soft_keyword.py | ||
match_attr_pattern_soft_keyword.py | ||
match_classify_as_identifier_1.py | ||
match_classify_as_identifier_2.py | ||
match_classify_as_keyword_1.py | ||
match_classify_as_keyword_2.py | ||
match_classify_as_keyword_or_identifier.py | ||
match_sequence_pattern_parentheses_terminator.py | ||
match_sequence_pattern_terminator.py | ||
match_stmt_subject_expr.py | ||
match_stmt_valid_guard_expr.py | ||
multiple_assignment_in_case_pattern.py | ||
nested_async_comprehension_py310.py | ||
nested_async_comprehension_py311.py | ||
non_duplicate_type_parameter_names.py | ||
non_rebound_comprehension_variable.py | ||
nonlocal_stmt.py | ||
param_with_annotation.py | ||
param_with_default.py | ||
param_with_star_annotation.py | ||
param_with_star_annotation_py310.py | ||
param_with_star_annotation_py311.py | ||
params_non_default_after_star.py | ||
params_seen_keyword_only_param_after_star.py | ||
parenthesized_context_manager_py39.py | ||
parenthesized_kwarg_py37.py | ||
parenthesized_named_expr_index_py38.py | ||
parenthesized_named_expr_py38.py | ||
parenthesized_star_index_py310.py | ||
pep701_f_string_py311.py | ||
pep701_f_string_py312.py | ||
pos_only_py38.py | ||
read_from_debug.py | ||
simple_stmts_in_block.py | ||
simple_stmts_with_semicolons.py | ||
single_star_in_tuple.py | ||
single_starred_assignment_target.py | ||
star_index_py311.py | ||
tuple_context_manager_py38.py | ||
type_param_default_py313.py | ||
type_param_param_spec.py | ||
type_param_type_var.py | ||
type_param_type_var_tuple.py | ||
type_stmt_py312.py | ||
unparenthesized_named_expr_index_py39.py | ||
unparenthesized_named_expr_py39.py | ||
valid_annotation_class.py | ||
valid_annotation_function_py313.py | ||
valid_annotation_py313.py | ||
walrus_py38.py |