-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Format comment before parameter default correctly (#7870)
**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.
- Loading branch information
Showing
3 changed files
with
126 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters