ruff/crates/ruff_python_formatter/src/comments
Micha Reiser 9d705a4414
Fix subscript comment placement with parenthesized value (#10496)
## Summary

This is a follow up on https://github.com/astral-sh/ruff/pull/10492 

I incorrectly assumed that `subscript.value.end()` always points past
the value. However, this isn't the case for parenthesized values where
the end "ends" before the parentheses.

## Test Plan

I added new tests for the parenthesized case.
2024-03-20 20:30:22 +00:00
..
snapshots Split Constant to individual literal nodes (#8064) 2023-10-30 12:13:23 +05:30
debug.rs Implement RUF028 to detect useless formatter suppression comments (#9899) 2024-02-28 19:21:06 +00:00
format.rs Ruff 2024.2 style (#9639) 2024-02-29 09:30:54 +01:00
map.rs Spellcheck & grammar (#10375) 2024-03-13 02:34:23 +00:00
mod.rs Implement RUF028 to detect useless formatter suppression comments (#9899) 2024-02-28 19:21:06 +00:00
node_key.rs Move {AnyNodeRef, AstNode} to ruff_python_ast crate root (#8030) 2023-10-18 00:01:18 +00:00
placement.rs Fix subscript comment placement with parenthesized value (#10496) 2024-03-20 20:30:22 +00:00
visitor.rs Implement RUF028 to detect useless formatter suppression comments (#9899) 2024-02-28 19:21:06 +00:00