ruff/crates/ruff_python_formatter/src/comments
konstin 930f03de98
Don't mistake a following if for an elif (#5296)
In the following code, the comment used to get wrongly associated with
the `if False` since it looked like an elif. This fixes it by checking
the indentation and adding a regression test
```python
if True:
    pass
else:  # Comment
    if False:
        pass
    pass
```
    
Originally found in
1570b94a02/gradio/external.py (L478)
2023-06-23 10:07:28 +02:00
..
snapshots Fix ArgWithDefault comments handling (#5204) 2023-06-20 20:48:07 +00:00
debug.rs Consistently name comment own line/end-of-line line_position() (#5215) 2023-06-21 11:04:56 +02:00
format.rs Consistently name comment own line/end-of-line line_position() (#5215) 2023-06-21 11:04:56 +02:00
map.rs Correctly associate own-line comments in bodies (#4671) 2023-06-01 08:12:53 +02:00
mod.rs Consistently name comment own line/end-of-line line_position() (#5215) 2023-06-21 11:04:56 +02:00
node_key.rs Correctly associate own-line comments in bodies (#4671) 2023-06-01 08:12:53 +02:00
placement.rs Don't mistake a following if for an elif (#5296) 2023-06-23 10:07:28 +02:00
visitor.rs Improve debuggability of place_comment (#5209) 2023-06-21 09:52:13 +00:00