Skip to content

Commit

Permalink
check we don't have comments without the node
Browse files Browse the repository at this point in the history
  • Loading branch information
davidszotten committed Jun 21, 2023
1 parent ec6dade commit cffeb1f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/ruff_python_formatter/src/statement/stmt_for.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ impl FormatNodeRule<StmtFor> for FormatStmtFor {
]
)?;

if !orelse.is_empty() {
if orelse.is_empty() {
debug_assert!(or_else_comments.is_empty());
} else {
// Split between leading comments before the `else` keyword and end of line comments at the end of
// the `else:` line.
let trailing_start =
Expand Down

0 comments on commit cffeb1f

Please sign in to comment.