Skip to content

Formatting

Don Jayamanne edited this page Feb 15, 2016 · 6 revisions

#Formatting

###Default Formatter Code formatting is supported using either one of yapf or autopep8.
The default code format provider is autopep8.
You can configure the format provider by changing a setting in the User or Workspace settings file as follows:

"python.formatting.provider": "autopep8"

If you wish to use yapf as the default format provider, then change the above setting to "yapf" instead of "autopep8".

Paths All samples provided here are for windows.
However Mac/Linux paths are also supported.

Custom Path It is assumed that the path to autopep8 is set in the current path.
If this is not the case or you wish to use another version of autopep8, all you need to do is configure the path as follows either in the User or Workspace settings file:

"python.formatting.autopep8Path": "c:/path/autopep8.exe",
"python.formatting.yapfPath": "c:/yapfPath/yapf.exe"
Clone this wiki locally