ruff/crates
Charlie Marsh e2b2b1759f
Handle keyword comments between = and value (#6883)
## Summary

This PR adds comment handling for comments between the `=` and the
`value` for keywords, as in the following cases:

```python
func(
    x  # dangling
    =  # dangling
    # dangling
    1,
    **  # dangling
    y
)
```

(Comments after the `**` were already handled in some cases, but I've
unified the handling with the `=` handling.)

Note that, previously, comments between the `**` and its value were
rendered as trailing comments on the value (so they'd appear after `y`).
This struck me as odd since it effectively re-ordered the comment with
respect to its closest AST node (the value). I've made them leading
comments, though I don't know that that's a significant improvement. I
could also imagine us leaving them where they are.
2023-08-30 09:52:51 -04:00
..
flake8_to_ruff Unify line size settings between ruff and the formatter (#6873) 2023-08-28 06:44:56 +00:00
ruff [perflint] Expand PERF401 and PERF402 with type checks (#6994) 2023-08-29 19:15:29 -04:00
ruff_benchmark Add unicode benchmark (#7002) 2023-08-30 09:57:57 +02:00
ruff_cache Error on zero tab width (#6429) 2023-08-08 16:51:37 -04:00
ruff_cli Reuse FormatResult and FormatterIterationError in format_stdin.rs (#6985) 2023-08-29 17:41:53 +00:00
ruff_dev Show changed files (#7003) 2023-08-30 06:47:45 +00:00
ruff_diagnostics Implement Ranged on more structs (#6921) 2023-08-27 19:03:08 +00:00
ruff_formatter Update dynamic_text builder doc comment (#6978) 2023-08-29 16:29:11 +02:00
ruff_index Add unreachable code rule (#5384) 2023-07-04 14:27:23 +00:00
ruff_macros Move Configuration to ruff_workspace crate (#6920) 2023-08-28 06:21:35 +00:00
ruff_python_ast [refurb] Implement repeated-append rule (FURB113) (#6702) 2023-08-28 22:51:59 +00:00
ruff_python_codegen Make Parameters an optional field on ExprLambda (#6669) 2023-08-18 15:34:54 +00:00
ruff_python_formatter Handle keyword comments between = and value (#6883) 2023-08-30 09:52:51 -04:00
ruff_python_index Move Ranged into ruff_text_size (#6919) 2023-08-27 14:12:51 -04:00
ruff_python_literal Avoid parsing other parts of a format specification if replacements are present (#6858) 2023-08-25 17:42:57 +00:00
ruff_python_parser Add eat_char2 for the lexer (#6968) 2023-08-29 17:18:02 +05:30
ruff_python_resolver Replace .map_or(false, $closure) with .is_some_and(closure) (#6244) 2023-08-01 19:29:42 +02:00
ruff_python_semantic Move refurb/helpers utils to ruff_python_semantic for broader use (#6990) 2023-08-29 14:45:09 -04:00
ruff_python_stdlib Add TOML files to SourceType (#6929) 2023-08-28 15:01:48 +00:00
ruff_python_trivia Implement Ranged on more structs (#6921) 2023-08-27 19:03:08 +00:00
ruff_shrinking Move Ranged into ruff_text_size (#6919) 2023-08-27 14:12:51 -04:00
ruff_source_file Allow Locator#slice to take Ranged (#6922) 2023-08-28 11:08:39 -04:00
ruff_text_size Unify line size settings between ruff and the formatter (#6873) 2023-08-28 06:44:56 +00:00
ruff_wasm Add comments option to playground (#6911) 2023-08-28 07:26:23 +00:00
ruff_workspace Fix typo in banned-from (#6977) 2023-08-29 09:39:09 -04:00