From eae68a41f6edf23d0f8d5f04c1b9469d60835135 Mon Sep 17 00:00:00 2001 From: Fabian Neundorf Date: Mon, 1 Aug 2016 12:06:33 +0000 Subject: Document how it determines when the plugin is run If a plugin's target (constructor or function) doesn't satisfy specific parameters, it'll never be called. This documents what the parameters must contain to be run at all. Related to: #159 --- docs/source/plugin-development/plugin-parameters.rst | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'docs/source/plugin-development') diff --git a/docs/source/plugin-development/plugin-parameters.rst b/docs/source/plugin-development/plugin-parameters.rst index a0e0177..fd644bc 100644 --- a/docs/source/plugin-development/plugin-parameters.rst +++ b/docs/source/plugin-development/plugin-parameters.rst @@ -54,6 +54,12 @@ 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. + Registering Options =================== -- cgit v1.2.1