mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-31 07:37:38 +00:00
![]() ## 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. |
||
---|---|---|
.. | ||
flake8_to_ruff | ||
ruff | ||
ruff_benchmark | ||
ruff_cache | ||
ruff_cli | ||
ruff_dev | ||
ruff_diagnostics | ||
ruff_formatter | ||
ruff_index | ||
ruff_macros | ||
ruff_python_ast | ||
ruff_python_codegen | ||
ruff_python_formatter | ||
ruff_python_index | ||
ruff_python_literal | ||
ruff_python_parser | ||
ruff_python_resolver | ||
ruff_python_semantic | ||
ruff_python_stdlib | ||
ruff_python_trivia | ||
ruff_shrinking | ||
ruff_source_file | ||
ruff_text_size | ||
ruff_wasm | ||
ruff_workspace |