summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorIan Cordasco <graffatcolmingov@gmail.com>2016-08-06 08:28:52 -0500
committerIan Cordasco <graffatcolmingov@gmail.com>2016-08-06 08:28:52 -0500
commitb0a99d0b63ad350b33be9ed3ebfccbb5c899b911 (patch)
treeef04df2f6880affeec40338967f7a35caf01a913 /docs
parent690d157d1b1ab696ff199525dd9d96e1d0400cba (diff)
downloadflake8-b0a99d0b63ad350b33be9ed3ebfccbb5c899b911.tar.gz
Replace list of violation codes
Closes #206
Diffstat (limited to 'docs')
-rw-r--r--docs/source/user/error-codes.rst49
-rw-r--r--docs/source/user/index.rst1
2 files changed, 50 insertions, 0 deletions
diff --git a/docs/source/user/error-codes.rst b/docs/source/user/error-codes.rst
new file mode 100644
index 0000000..9a2c26b
--- /dev/null
+++ b/docs/source/user/error-codes.rst
@@ -0,0 +1,49 @@
+=========================
+ Error / Violation Codes
+=========================
+
+Flake8 and its plugins assign a code to each message that we refer to as a
+:term:`error code` (or :term:`violation`). Most plugins will list their error
+codes in their documentation or README.
+
+Flake8 installs ``pycodestyle``, ``pyflakes``, and ``mccabe`` by default and
+generates its own :term:`error code`\ s for ``pyflakes``:
+
++------+---------------------------------------------------------------------+
+| Code | Example Message |
++======+=====================================================================+
+| F401 | ``module`` imported but unused |
++------+---------------------------------------------------------------------+
+| F402 | import ``module`` from line ``N`` shadowed by loop variable |
++------+---------------------------------------------------------------------+
+| F403 | 'from ``module`` import \*' used; unable to detect undefined names |
++------+---------------------------------------------------------------------+
+| F404 | future import(s) ``name`` after other statements |
++------+---------------------------------------------------------------------+
+| F405 | ``name`` may be undefined, or defined from star imports: ``module`` |
++------+---------------------------------------------------------------------+
++------+---------------------------------------------------------------------+
+| F811 | redefinition of unused ``name`` from line ``N`` |
++------+---------------------------------------------------------------------+
+| F812 | list comprehension redefines ``name`` from line ``N`` |
++------+---------------------------------------------------------------------+
+| F821 | undefined name ``name`` |
++------+---------------------------------------------------------------------+
+| F822 | undefined name ``name`` in __all__ |
++------+---------------------------------------------------------------------+
+| F823 | local variable ``name`` ... referenced before assignment |
++------+---------------------------------------------------------------------+
+| F831 | duplicate argument ``name`` in function definition |
++------+---------------------------------------------------------------------+
+| F841 | local variable ``name`` is assigned to but never used |
++------+---------------------------------------------------------------------+
+
+``mccabe`` only ever reports one :term:`violation` - ``C901`` based on the
+complexity value provided by the user.
+
+Users should also reference `pycodestyle's list of error codes`_.
+
+
+.. links
+.. _pycodestyle's list of error codes:
+ https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes
diff --git a/docs/source/user/index.rst b/docs/source/user/index.rst
index 0df911e..e008eb2 100644
--- a/docs/source/user/index.rst
+++ b/docs/source/user/index.rst
@@ -23,6 +23,7 @@ This guide will cover all of these and the nuances for using |Flake8|.
invocation
configuration
options
+ error-codes
ignoring-errors
using-plugins
python-api