mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-27 04:19:18 +00:00
![]() **Summary** Handle comment before the default values of function parameters correctly by inserting a line break instead of space after the equals sign where required. ```python def f( a = # parameter trailing comment; needs line break 1, b = # default leading comment; needs line break 2, c = ( # the default leading can only be end-of-line with parentheses; no line break 3 ), d = ( # own line leading comment with parentheses; no line break 4 ) ) ``` Fixes #7603 **Test Plan** Added the different cases and one more complex case as fixtures. |
||
---|---|---|
.. | ||
comments | ||
expression | ||
module | ||
other | ||
pattern | ||
snapshots | ||
statement | ||
type_param | ||
builders.rs | ||
cli.rs | ||
context.rs | ||
generated.rs | ||
lib.rs | ||
main.rs | ||
options.rs | ||
prelude.rs | ||
verbatim.rs |