-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
-
as source file not allowed when using the --stdin-filename
option (unlike in Black)
#492
Comments
Hi @my-tien, thanks for the report! Can you find the full Darker command line in an output/debug window? The correct format is
So the path of the file must immediately follow the If you can't find the used command line inside VSCode, you can modify Darker's source code to catch the exception at |
Hi, this is the generated Darker command:
So maybe the hyphen at the end is the problem? |
Yes, probably the hyphen is the problem. So Darker is then not fully compatible as a drop-in replacement for Black. This should certainly be fixed. Could you still verify that Black indeed works with a similar command line:
Thanks! I'll then think about how to best create the fix for the problem. |
I did not have time to test this on my initial machine again, but on my Linux machine at home I successfully reproduced the problem on the command line. Since the hyphen at the end expects something on stdin, you need to adapt the command like below:
|
stdin-filename
option-
as source file not allowed when using the --stdin-filename
option (unlike in Black)
Describe the bug
I have the Black Formatter extension and configured darker in the black formatter path.
When formatting on save in VSCode, the output log will contain below error.
NOTE: everything works fine when not using the Black Formatter extension, but using the formatter feature of the Python extension (ms-python.python) instead.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Reformatted file
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: