summaryrefslogtreecommitdiff
path: root/docs/source
diff options
context:
space:
mode:
authorIan Cordasco <graffatcolmingov@gmail.com>2016-10-25 17:14:28 +0000
committerIan Cordasco <graffatcolmingov@gmail.com>2016-10-25 17:14:28 +0000
commit86819c153b4eafba1549ce93bc084ef9100c0ac1 (patch)
tree5278926067a9782eb5f4cde88ae5ed14d6bff074 /docs/source
parenta90c94ab2281737c038bcdca873c6f07239eee59 (diff)
parent8dfe38e9e6541185e78a25d684ca1a4a4d9695b0 (diff)
downloadflake8-86819c153b4eafba1549ce93bc084ef9100c0ac1.tar.gz
Merge branch 'mr/80' into 'master'
Provide complete list of file's tokens to plugins Supersedes !80 See merge request !127
Diffstat (limited to 'docs/source')
-rw-r--r--docs/source/plugin-development/plugin-parameters.rst22
1 files changed, 11 insertions, 11 deletions
diff --git a/docs/source/plugin-development/plugin-parameters.rst b/docs/source/plugin-development/plugin-parameters.rst
index fd644bc..1625098 100644
--- a/docs/source/plugin-development/plugin-parameters.rst
+++ b/docs/source/plugin-development/plugin-parameters.rst
@@ -40,25 +40,25 @@ a file, a plugin can ask for any of the following:
- :attr:`~flake8.processor.FileProcessor.previous_logical`
- :attr:`~flake8.processor.FileProcessor.tokens`
-Some properties are set once per file being processed:
+Some properties are set once per file for plugins which iterate itself over
+the data instead of being called on each physical or logical line.
- :attr:`~flake8.processor.FileProcessor.filename`
+- :attr:`~flake8.processor.FileProcessor.file_tokens`
- :attr:`~flake8.processor.FileProcessor.lines`
- :attr:`~flake8.processor.FileProcessor.max_line_length`
- :attr:`~flake8.processor.FileProcessor.total_lines`
- :attr:`~flake8.processor.FileProcessor.verbose`
These parameters can also be supplied to plugins working on each line
-separately. Additionally, plugins called once per file can also accept ``tree``
-which is not supplied as a parameter of
-:class:`~flake8.processor.FileProcessor`, which will be a parsed abstract
-syntax tree. It is used by plugins like PyFlakes and McCabe.
-
-When the plugin is run depends on the first parameter, not counting ``self``.
-It can be either ``physical_line``, ``logical_line`` or ``tree``. If the
-parameter is ``tree``, it is run once per file, otherwise once per physical
-line or logical line respectively. If the plugin is using neither of them it
-won't be run at all.
+separately.
+
+Plugins that depend on ``physical_line`` or ``logical_line`` are run on each
+physical or logical line once. These parameters should be the first in the
+list of arguments (with the exception of ``self``). Plugins that need an AST
+(e.g., PyFlakes and McCabe) should depend on ``tree``. These plugins will run
+once per file. The parameters listed above can be combined with
+``physical_line``, ``logical_line``, and ``tree``.
Registering Options