Open lolo120916 opened 10 months ago
Hello,
I'm encountering an issue with how yapf handles the formatting of a very long list of lists. With my configuration file (see attached file below), the following code:
for idxs in ([1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 0], [1, 1, 0, 1, 1, 0], [1, 1, 0, 0, 1, 0], [1, 1, 1, 1, 1, 1]): pass
is formatted by yapf as follows:
which is really ugly. The expected formatting would be:
for idxs in ( [1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 0], [1, 1, 0, 1, 1, 0], [1, 1, 0, 0, 1, 0], [1, 1, 1, 1, 1, 1] ): pass
Similarly, if process is a function,
process
process([1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 0], [1, 1, 0, 1, 1, 0], [1, 1, 0, 0, 1, 0], [1, 1, 1, 1, 1, 1])
yields:
while the expected formatting (with my settings) is:
process( [1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 0], [1, 1, 0, 1, 1, 0], [1, 1, 0, 0, 1, 0], [1, 1, 1, 1, 1, 1] )
However,
process(qdf, qdf, qdf, qdf, qdf, qdf, qdf, qdf, qdf, qdf, qdf, qdf, qdf, qdf, qdf, qdf,qdf,qdf)
is correctly formatted as expected:
process( qdf, qdf, qdf, qdf, qdf, qdf, qdf, qdf, qdf, qdf, qdf, qdf, qdf, qdf, qdf, qdf, qdf, qdf )
Is this an incorrect behavior of yapf, or is it a configuration issue on my part? Thank you for your help.
Python 3.11.5 - Windows 10 x64 - yapf 0.40.1 Usage: vscode 1.84.2, eeyore 0.1.10 style.yapf.txt
Can I work on this issue? @bwendling
Hello,
I'm encountering an issue with how yapf handles the formatting of a very long list of lists. With my configuration file (see attached file below), the following code:
is formatted by yapf as follows:
which is really ugly. The expected formatting would be:
Similarly, if
process
is a function,yields:
while the expected formatting (with my settings) is:
However,
is correctly formatted as expected:
Is this an incorrect behavior of yapf, or is it a configuration issue on my part? Thank you for your help.
Python 3.11.5 - Windows 10 x64 - yapf 0.40.1 Usage: vscode 1.84.2, eeyore 0.1.10 style.yapf.txt