yapf icon indicating copy to clipboard operation
yapf copied to clipboard

Yapf doesn't diff trailing newline added

Open thejcannon opened this issue 3 years ago • 1 comments

Given:

x
\ No newline at end of file

yapf --diff reports nothing

$ yapf --diff file.py
$

however, running --in-place, yapf adds a newline.

thejcannon avatar Aug 13 '22 17:08 thejcannon

Same here, on 0.32.0. For me the issue is 100% related, but the way this is hurting me is that in my IDE no newlines are added by yapf when saving.

When I manually run yapf -i myfile.py then it gets added, but not from my IDE. There is also some IDE stuff going on.

In nvim: when I manually add a newline and save, the newline disappears.

In vscode: when I manually add a newline and save, the newline stays.

But in both cases I have to manually add a newline to get it there.

dhensen avatar Oct 06 '22 08:10 dhensen