-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Issue with autoFormatOnSave and yapf #124
Comments
From @seanbrant on August 10, 2017 2:42 @dcramer I was running into this as well and might have a temporary solution.
|
From @dcramer on August 10, 2017 4:57 @seanbrant great idea! Will give this a try tomorrow and report back. |
From @yegorski on October 16, 2017 15:57 As far as
Now on my Mac's VS Code, pressing Option + Shift + F formats the files I want to format. |
@yegorski, apologies for not having resolved this issue yet. Will look into this soon. I believe I know the problem (I'm creating a temporary file to perform the formatting, and in doing so, the config file isn't picked up) |
Is there any workaround for this in the meantime? |
Yes, the work around is as follows: As pointed out by @seanbrant (#124 (comment)) |
Unfortunately that doesn't seem to work (I did use .style.yapf instead of setup.cfg, but I don't think that should make a difference). |
Does it make a difference if you use |
@sztomi Please can you confirm it works when you run yapf from the command line |
Same as #590 |
I have a similar issue with
Note that UPDATE: 030918: My problem is fixed by providing the full path to the yapf style file. |
There is a one file "0001_initial.py" which VS Code doesn't format with |
@osya can you open a new issue? |
@brettcannon I tried to reproduce this issue, but I can't. This file
|
Without knowing what your settings are set to I don't know. Please open a separate issue. |
I believe it's another manifestation of saving temporary files outside the workspace so the tools can't find their config files. It should be fixed on master. |
See #730 |
From @dcramer on June 1, 2017 6:44
Environment data
VS Code version: 1.12.2 (tried Insiders as well)
Python Extension version: 0.6.4
Python Version: 2.7.13
OS and version: macOS Sierra 10.12.4
Actual behavior
Upon save it reformats the file, and does not appear to behave the same as
yapf -i file
.For example, this content:
When I hit save, it generates invalid Python:
Expected behavior
The expected output should be:
Steps to reproduce:
editor.formatOnSave
to workspace settingsEven when it doesnt incorrectly format the file into invalid Python, it doesnt seem to respect the configuration within setup.cfg (i still get different output from yapf -i).
Here is the changeset which we identified this behavior in:
getsentry/sentry@a2587aa
Settings
Your launch.json (if dealing with debugger issues):
Your settings.json:
Copied from original issue: DonJayamanne/pythonVSCode#992
The text was updated successfully, but these errors were encountered: