summaryrefslogtreecommitdiff
path: root/docs/intro.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/intro.rst')
-rw-r--r--docs/intro.rst31
1 files changed, 30 insertions, 1 deletions
diff --git a/docs/intro.rst b/docs/intro.rst
index 5e3af1f..1bcafe8 100644
--- a/docs/intro.rst
+++ b/docs/intro.rst
@@ -111,6 +111,33 @@ Or you can display how often each error was found::
612 W601 .has_key() is deprecated, use 'in'
1188 W602 deprecated form of raising exception
+You can also make pep8.py show the error text in different formats by using --format having options default/pylint/custom::
+
+ $ pep8 testsuite/E40.py --format=default
+ testsuite/E40.py:2:10: E401 multiple imports on one line
+
+ $ pep8 testsuite/E40.py --format=pylint
+ testsuite/E40.py:2: [E401] multiple imports on one line
+
+ $ pep8 testsuite/E40.py --format='%(path)s|%(row)d|%(col)d| %(code)s %(text)s'
+ testsuite/E40.py|2|10| E401 multiple imports on one line
+
+Variables in the ``custom`` format option
+
++----------------+------------------+
+| Variable | Significance |
++================+==================+
+| ``path`` | File name |
++----------------+------------------+
+| ``row`` | Row number |
++----------------+------------------+
+| ``col`` | Column number |
++----------------+------------------+
+| ``code`` | Error code |
++----------------+------------------+
+| ``text`` | Error text |
++----------------+------------------+
+
Quick help is available on the command line::
$ pep8 -h
@@ -158,7 +185,7 @@ Configuration
The behaviour may be configured at two levels.
-The user settings are read from the ``~/.config/pep8`` file and
+The user settings are read from the ``~/.config/pep8`` file and
for Windows from the ``~\.pep8`` file.
Example::
@@ -297,6 +324,8 @@ This is the current list of error and warning codes:
+----------+----------------------------------------------------------------------+
| E401 | multiple imports on one line |
+----------+----------------------------------------------------------------------+
+| E402 | module level import not at top of file |
++----------+----------------------------------------------------------------------+
+----------+----------------------------------------------------------------------+
| **E5** | *Line length* |
+----------+----------------------------------------------------------------------+