Closed
Description
Environment data
VSCode: Most recent non-insider version.
Python: 3.7
Black: Most recent.
Expected behaviour
Black is registered as a formatter.
Code is formatted.
Actual behaviour
Nothing happens.
Steps to reproduce:
Working:
- Register black as the formatter of choice.
- Create a directory with the following structure:
root
- project
- file_to_be_formatted.py
- Add some code into
file_to_be_formatted.py
that has formatting issues. - Run black with
alt + shift + f
. It formats the code!
Failing:
- Register black as the formatter of choice.
- Create a directory with the following structure:
root
- .env (This contains "PYTHONPATH=./project" to make properly configure package detection, etc.)
- project
- file_to_be_formatted.py
- Add some code into
file_to_be_formatted.py
that has formatting issues. - Run black with
alt + shift + f
. It does not format the code
So having a .env
file will silently make black fail. Running black from the command line on file_to_be_formatted.py
does still work
I follow this: https://github.com/microsoft/python-language-server/blob/master/TROUBLESHOOTING.md#unresolved-import-warnings