<type>documentation</type>
<domain>edit</domain>
<id>pep8</id>
<title>PEP 8 Reformatting Options</title>
<date>$Date: 2011-05-04 11:47:03 -0400 (Wed, 04 May 2011) $</date>
<version>$Revision: 24521 $</version>
<product>all</product>

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 <script:show_preferences_gui#prefname="edit.text-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.
~~~if not WING101:
  To convert indentation to other styles or sizes, use the `Indentation Manager
  <ref:edit/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
to the top of the file.  This is disabled by default.
  
