ruff/crates/ruff_python_formatter/src/comments
Charlie Marsh cc9e84c144
Format trailing operator comments as dangling (#7427)
## Summary

Given a trailing operator comment in a unary expression, like:

```python
if (
  not  # comment
  a):
    ...
```

We were attaching these to the operand (`a`), but formatting them in the
unary operator via special handling. Parents shouldn't format the
comments of their children, so this instead attaches them as dangling
comments on the unary expression. (No intended change in formatting.)
2023-09-15 20:34:09 -04:00
..
snapshots Treat empty-line separated comments as trailing statement comments (#6999) 2023-08-31 20:55:05 +00:00
debug.rs Move `Ranged` into `ruff_text_size` (#6919) 2023-08-27 14:12:51 -04:00
format.rs Introduce `IndentWidth` (#7301) 2023-09-13 14:52:24 +02:00
map.rs Use single lookup for leading, dangling, and trailing comments (#6589) 2023-08-15 17:39:45 +02:00
mod.rs Split implicit concatenated strings before binary expressions (#7145) 2023-09-08 06:51:26 +00:00
node_key.rs Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
placement.rs Format trailing operator comments as dangling (#7427) 2023-09-15 20:34:09 -04:00
visitor.rs Reuse locator in formatter comments (#7227) 2023-09-07 20:08:28 +02:00