mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 13:24:57 +00:00
[pyupgrade
] Prevent infinite loop with I002
(UP010
, UP035
) (#19413)
## Summary Fixes #18729 and fixes #16802 ## Test Plan Manually verified via CLI that Ruff no longer enters an infinite loop by running: ```sh echo 1 | ruff --isolated check - --select I002,UP010 --fix ``` with `required-imports = ["from __future__ import generator_stop"]` set in the config, confirming “All checks passed!” and no snapshots were generated. --------- Co-authored-by: Brent Westbrook <brentrwestbrook@gmail.com>
This commit is contained in:
parent
2ab1502e51
commit
b07def07c9
4 changed files with 123 additions and 7 deletions
|
@ -380,7 +380,7 @@ macro_rules! assert_diagnostics {
|
|||
}};
|
||||
($value:expr, @$snapshot:literal) => {{
|
||||
insta::with_settings!({ omit_expression => true }, {
|
||||
insta::assert_snapshot!($crate::test::print_messages(&$value), $snapshot);
|
||||
insta::assert_snapshot!($crate::test::print_messages(&$value), @$snapshot);
|
||||
});
|
||||
}};
|
||||
($name:expr, $value:expr) => {{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue