PEP 8 Reformatting Options

Index of All Documentation » Wing Pro Reference Manual » Source Code Editor » Auto-Reformatting »


For PEP 8 reformatting, Wing uses an integrated copy of autopep8. There is no need to install anything to use this style of reformatting.

Several options for PEP 8 formatting are provided in the Editor > Auto-formatting preferences group:

  • Enforce Line Length applies PEP 8 style line wrapping during reformatting, using the wrap column configured with the Editor > Line Wrapping > Reformatting Wrap Column preference. This is disabled by default, allowing any line length.
  • Reindent All Lines in Files causes all lines to be reindented with 4-space indentation when PEP 8 reformatting an entire file. When this is disabled, reformatting may still alter indentation within logical lines of code. When reformatting selections, this preference is ignored and only indentation within logical lines may be changed. To convert indentation to other styles or sizes, use the Indentation Manager.
  • Spaces Around = in Argument Lists overrides PEP 8 by inserting spaces around = in argument lists. This is disabled by default.
  • Spaces After # can be disabled to override PEP 8 insertion of spaces after comment characters. This is enabled by default.
  • Move Imports to Top can be enabled to enforce PEP 8 requirements to move all imports

System Message: WARNING/2 (<string>, line 26); backlinks:

Bullet list ends without a blank line; unexpected unindent.

to the top of the file. This is disabled by default.