summaryrefslogtreecommitdiff
path: root/docs/source
diff options
context:
space:
mode:
authorAnthony Sottile <asottile@umich.edu>2018-12-27 16:55:15 -0800
committerAnthony Sottile <asottile@umich.edu>2018-12-27 16:55:15 -0800
commitbe88d2639694da77d07a9075231a0bea2b8df3f5 (patch)
tree31b08b45819030d11a6321b88416082756241cd1 /docs/source
parent6ad56f73daa1a23081ed40a409d53ef28bf53c3f (diff)
downloadflake8-be88d2639694da77d07a9075231a0bea2b8df3f5.tar.gz
Remove unused and broken flake8.listen plugin type
Diffstat (limited to 'docs/source')
-rw-r--r--docs/source/internal/plugin_handling.rst40
-rw-r--r--docs/source/plugin-development/registering-plugins.rst5
2 files changed, 4 insertions, 41 deletions
diff --git a/docs/source/internal/plugin_handling.rst b/docs/source/internal/plugin_handling.rst
index 9af3182..faf3996 100644
--- a/docs/source/internal/plugin_handling.rst
+++ b/docs/source/internal/plugin_handling.rst
@@ -4,15 +4,13 @@ Plugin Handling
Plugin Management
-----------------
-|Flake8| 3.0 added support for two other plugins besides those which define
+|Flake8| 3.0 added support for other plugins besides those which define
new checks. It now supports:
- extra checks
- alternative report formatters
-- listeners to auto-correct violations of checks
-
To facilitate this, |Flake8| needed a more mature way of managing plugins.
Thus, we developed the |PluginManager| which accepts a namespace and will load
the plugins for that namespace. A |PluginManager| creates and manages many
@@ -38,12 +36,10 @@ the |PTM| will subclass it and specify the ``namespace``, e.g.,
This provides a few extra methods via the |PluginManager|'s ``map`` method.
-Finally, we create three classes of plugins:
+Finally, we create two classes of plugins:
- :class:`~flake8.plugins.manager.Checkers`
-- :class:`~flake8.plugins.manager.Listeners`
-
- :class:`~flake8.plugins.manager.ReportFormatters`
These are used to interact with each of the types of plugins individually.
@@ -53,29 +49,6 @@ These are used to interact with each of the types of plugins individually.
Our inspiration for our plugin handling comes from the author's extensive
experience with ``stevedore``.
-Notifying Listener Plugins
---------------------------
-
-One of the interesting challenges with allowing plugins to be notified each
-time an error or warning is emitted by a checker is finding listeners quickly
-and efficiently. It makes sense to allow a listener to listen for a certain
-class of warnings or just a specific warning. Hence, we need to allow all
-plugins that listen to a specific warning or class to be notified. For
-example, someone might register a listener for ``E1`` and another for ``E111``
-if ``E111`` is triggered by the code, both listeners should be notified.
-If ``E112`` is returned, then only ``E1`` (and any other listeners) would be
-notified.
-
-To implement this goal, we needed an object to store listeners in that would
-allow for efficient look up - a Trie (or Prefix Tree). Given that none of the
-existing packages on PyPI allowed for storing data on each node of the trie,
-it was left up to write our own as :class:`~flake8.plugins._trie.Trie`. On
-top of that we layer our :class:`~flake8.plugins.notifier.Notifier` class.
-
-Now when |Flake8| receives an error or warning, we can easily call the
-:meth:`~flake8.plugins.notifier.Notifier.notify` method and let plugins act on
-that knowledge.
-
Default Plugins
---------------
@@ -103,7 +76,7 @@ API Documentation
.. autoclass:: flake8.plugins.manager.PluginManager
:members:
- :special-members: __init__, __contains__, __getitem__
+ :special-members: __init__
.. autoclass:: flake8.plugins.manager.Plugin
:members:
@@ -115,15 +88,8 @@ API Documentation
.. autoclass:: flake8.plugins.manager.Checkers
:members:
-.. autoclass:: flake8.plugins.manager.Listeners
- :members: build_notifier
-
.. autoclass:: flake8.plugins.manager.ReportFormatters
-.. autoclass:: flake8.plugins.notifier.Notifier
-
-.. autoclass:: flake8.plugins._trie.Trie
-
.. |PluginManager| replace:: :class:`~flake8.plugins.manager.PluginManager`
.. |Plugin| replace:: :class:`~flake8.plugins.manager.Plugin`
.. |PTM| replace:: :class:`~flake8.plugins.manager.PluginTypeManager`
diff --git a/docs/source/plugin-development/registering-plugins.rst b/docs/source/plugin-development/registering-plugins.rst
index 39c3083..6d901d7 100644
--- a/docs/source/plugin-development/registering-plugins.rst
+++ b/docs/source/plugin-development/registering-plugins.rst
@@ -86,13 +86,10 @@ grouping of entry-points that flake8 should look in.
- ``flake8.extension``
-- ``flake8.listen``
-
- ``flake8.report``
If your plugin is one that adds checks to |Flake8|, you will use
-``flake8.extension``. If your plugin automatically fixes errors in code, you
-will use ``flake8.listen``. Finally, if your plugin performs extra report
+``flake8.extension``. If your plugin performs extra report
handling (formatting, filtering, etc.) it will use ``flake8.report``.
If our ``ExamplePlugin`` is something that adds checks, our code would look