diff options
| author | Fabian Neundorf <CommodoreFabianus@gmx.de> | 2016-07-25 11:42:05 +0000 |
|---|---|---|
| committer | Fabian Neundorf <CommodoreFabianus@gmx.de> | 2016-07-25 15:45:44 +0200 |
| commit | 3191c44cfc1aa6081701ee15162d737e0e43e785 (patch) | |
| tree | 8ff8fa15819cc04bcaa18c63f77b45ae0fcd9705 /docs/source/plugin-development | |
| parent | 217aa8185c784f6514ef2004c110e1f33d4dc6c3 (diff) | |
| download | flake8-3191c44cfc1aa6081701ee15162d737e0e43e785.tar.gz | |
Update documentation to separate parameter types
It updates the documentation to separate which parameters are static and
which are changed on each line. Using the latter parameters on plugins which
are only run once per file isn't very sensible.
Diffstat (limited to 'docs/source/plugin-development')
| -rw-r--r-- | docs/source/plugin-development/plugin-parameters.rst | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/docs/source/plugin-development/plugin-parameters.rst b/docs/source/plugin-development/plugin-parameters.rst index 3c4534a..a0e0177 100644 --- a/docs/source/plugin-development/plugin-parameters.rst +++ b/docs/source/plugin-development/plugin-parameters.rst @@ -34,18 +34,25 @@ a file, a plugin can ask for any of the following: - :attr:`~flake8.processor.FileProcessor.indent_level` - :attr:`~flake8.processor.FileProcessor.line_number` - :attr:`~flake8.processor.FileProcessor.logical_line` -- :attr:`~flake8.processor.FileProcessor.max_line_length` - :attr:`~flake8.processor.FileProcessor.multiline` - :attr:`~flake8.processor.FileProcessor.noqa` - :attr:`~flake8.processor.FileProcessor.previous_indent_level` - :attr:`~flake8.processor.FileProcessor.previous_logical` - :attr:`~flake8.processor.FileProcessor.tokens` + +Some properties are set once per file being processed: + +- :attr:`~flake8.processor.FileProcessor.filename` +- :attr:`~flake8.processor.FileProcessor.lines` +- :attr:`~flake8.processor.FileProcessor.max_line_length` - :attr:`~flake8.processor.FileProcessor.total_lines` - :attr:`~flake8.processor.FileProcessor.verbose` -Alternatively, a plugin can accept ``tree`` and ``filename``. -``tree`` will be a parsed abstract syntax tree that will be used by plugins -like PyFlakes and McCabe. +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. Registering Options |
