When trying to format a document in Visual Studio using the autopep8 formatter, an error is thrown when there is no newline at the end of the file. Please see https://github.com/microsoft/PTVS/issues/6752 for details.
Python Code (remove the newline at the end!!!)
######this is a comment
import os,sys;
spam( ham [ 1 ], { eggs : 2 } )
def foo ():pass
x=1;y =2;
y = 2
#comment no newline
When trying to format a document in Visual Studio using the autopep8 formatter, an error is thrown when there is no newline at the end of the file. Please see https://github.com/microsoft/PTVS/issues/6752 for details.
Python Code (remove the newline at the end!!!)
The error looks like this:
Command Line and Configuration
Looks like the command is run by the PTVS extension here: https://github.com/microsoft/PTVS/blob/main/Python/Product/PythonTools/PythonTools/Editor/Formatting/PythonFormatterAutopep8.cs#L27
Your Environment