summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJason Myers <jason@jasonamyers.com>2015-12-19 15:38:48 -0600
committerJason Myers <jason@jasonamyers.com>2015-12-19 15:48:32 -0600
commita08a65b982a555c05c22068da4e2d760a62928fe (patch)
treee5d009db39b53a55c8ec2eba748067f697bcf000 /docs
parentb50c5109709292707ed90be54700729b132af8f1 (diff)
downloadflake8-a08a65b982a555c05c22068da4e2d760a62928fe.tar.gz
Adding docs for off by default
This adds documentation for the off_by_default option for extensions, which was added in MR !14. Signed-off-by: Jason Myers <jason@jasonamyers.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/extensions.rst21
1 files changed, 20 insertions, 1 deletions
diff --git a/docs/extensions.rst b/docs/extensions.rst
index fbab60a..def8047 100644
--- a/docs/extensions.rst
+++ b/docs/extensions.rst
@@ -103,6 +103,25 @@ flake8 registers the extension:
Since that is the defined entry point in the above ``setup.py``, flake8 finds
it and uses it to register the extension.
+If we wanted the extension or a check to be optional, you can add
+``off_by_default = True`` to our entry point. For example, we could
+update ``mccabe.py`` with this variable as shown below:
+
+.. code-block:: python
+
+ # https://github.com/flintwork/mccabe/blob/0.2/mccabe.py#L225:L254
+ class McCabeChecker(object):
+ """McCabe cyclomatic complexity checker."""
+ name = 'mccabe'
+ version = __version__
+ off_by_default = True
+
+If we wanted to run the optional extension or check, we need to specify the
+error and warnings via the ``select`` setting or command line argument. In our
+case, we could run ``flake8 --select=C90`` which would run our off_by_default
+example version of the mccabe extension.
+
+
Existing Extensions
===================
@@ -127,4 +146,4 @@ listing of the ones we are aware of:
.. links
.. _mccabe: https://github.com/flintwork/mccabe
-.. _PyPI: https://pypi.python.org/pypi/ \ No newline at end of file
+.. _PyPI: https://pypi.python.org/pypi/