-
Notifications
You must be signed in to change notification settings - Fork 37
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
Could not get black formatter working on WSL #522
Comments
Try this setting: |
Thanks for the quick response. I tried both stdio and pipe and it looks like I get the same log message after rebooting/saving a file I want to format: Here's my new settings file:
|
I will bed the full log to see exactly what the error is. |
Sure thing, is the log given in the issue post missing information? (under 'Click Here for Detailed Log') How can I get that full log for you? |
@cogerk Sorry I missed that. |
In a terminal can you run this:
It should just run and not crash. This is a very strange case where nothing is erroring out in a way that is telling me what is failing. Typically, the |
It looks like it runs and just hangs, but it doesn't crash! Is that expected behavior? It doesn't auto format on save while running either |
Thanks for your patience with me getting back to you on this! I ended up switching to the pre-release version from the extension view, couldn't find it from the Install Specific Version command, not sure if that is a clue? Regardless, it looks like neither the pre-release version nor Ruff were able to run the server. I also noticed that pylint is having trouble running as well: Is there anyway that this could be a firewall issue? |
I am not sure what changed between yesterday and today, but it's running great suddenly! I opened the developer tools and saved my 'test.py' file to get the error call stacks, and it formatted. After a reboot, it's still formatting fine! Happy to do any legwork that would be helpful in tracking down what might have been going on, but I'm also OK to close if you are. |
Yesterday after switching to the pre-release version, I only restarted vscode, not my computer, so that might have been it? |
Thank you for letting me know. We can close, but if this occurs again, What I would need is the calls stacks from the the developer tools , if there are no errors reported in the tool logs. FYI. If you have Ruff you can actually just remove black, and use ruff as your formatter. It implements |
great tip, thanks very much for all your help! |
Diagnostic Data
Behaviour
Expected vs. Actual Behavior
I expected black to automatically format this test.py file on save, but nothing happens.
Trying to restart the black server yields an error:
Reproduction Steps:
Here's my user settings json:
And my remote json:
Logs:
Click here for detailed logs
Outcome When Attempting Debugging Steps:
ctrl-F "command" and "running" in my trace log output found 0 results
Extra Details
Other Extensions:
I also posted this on stack overflow first: https://stackoverflow.com/questions/78634195/wsl2-vscode-black-extension-isnt-formatting-on-save
Thanks for your insights!
The text was updated successfully, but these errors were encountered: