ruff/crates/ruff_python_formatter/resources
Dylan 116611bd39
Fix finding keyword range for clause header after statement ending with semicolon (#21067)
When formatting clause headers for clauses that are not their own node,
like an `else` clause or `finally` clause, we begin searching for the
keyword at the end of the previous statement. However, if the previous
statement ended in a semicolon this caused a panic because we only
expected trivia between the end of the last statement and the keyword.

This PR adjusts the starting point of our search for the keyword to
begin after the optional semicolon in these cases.

Closes #21065
2025-10-27 09:52:17 -05:00
..
test/fixtures Fix finding keyword range for clause header after statement ending with semicolon (#21067) 2025-10-27 09:52:17 -05:00