Skip to content

Commit b0896e8

Browse files
committed
Added usage instructions for autopep8
1 parent 06fcb71 commit b0896e8

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

docs/writing/style.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,23 @@ Then run it on a file or series of files to get a report of any violations.
452452
optparse.py:472:29: E221 multiple spaces before operator
453453
optparse.py:544:21: W601 .has_key() is deprecated, use 'in'
454454
455+
The program `autopep8 <https://pypi.python.org/pypi/autopep8/>`_ can be used to
456+
automatically reformat code in the PEP 8 style. Install the program with:
457+
458+
.. code-block:: console
459+
460+
$ pip install autopep8
461+
462+
Use it to format a file in-place with:
463+
464+
.. code-block:: console
465+
466+
$ autopep8 --in-place optparse.py
467+
468+
Excluding the ``--in-place`` flag will cause the program to output the modified
469+
code directly to the console for review. The ``--aggressive`` flag will perform
470+
more substantial changes and can be applied multiple times for greater effect.
471+
455472
Conventions
456473
----------------
457474

0 commit comments

Comments
 (0)