mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-06 13:06:53 +00:00
Fix typos, grammar, and Flake8 references
This commit is contained in:
parent
41cdcbe10e
commit
a46b9b0670
2 changed files with 9 additions and 8 deletions
|
|
@ -24,11 +24,12 @@ how it needs to call it:
|
||||||
entry point references is called for each physical line and the call is
|
entry point references is called for each physical line and the call is
|
||||||
expected to yield results directly.
|
expected to yield results directly.
|
||||||
* If the callable has a parameter called ``logical_line`` then the callable
|
* If the callable has a parameter called ``logical_line`` then the callable
|
||||||
referred to by the entry point will be called from Flake8 with each logical
|
referred to by the entry point will be called from |Flake8| with each logical
|
||||||
line and is expected to yield results.
|
line and is expected to yield results.
|
||||||
|
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
Class-style plugins are only supported for AST checker (*tree*) plugins.
|
Class-style plugins are only supported for AST checker (*tree*) plugins.
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -38,15 +39,15 @@ The Results
|
||||||
Tree plugins
|
Tree plugins
|
||||||
------------
|
------------
|
||||||
|
|
||||||
A tree plugins can be a function or a class. If it is a function, it must take
|
A tree plugin can be a function or a class. If it is a function, it must take
|
||||||
a parameter called ``tree``. If it is a class, then the ``__init__`` method
|
a parameter called ``tree``. If it is a class, then the ``__init__`` method
|
||||||
must take this parameter.
|
must take this parameter.
|
||||||
|
|
||||||
For a class based plugin, the ``run`` method is in charge of yielding results.
|
For a class-based plugin, the ``run`` method is in charge of yielding results.
|
||||||
For functions, they must deliver results directly.
|
For functions, they must deliver results directly.
|
||||||
|
|
||||||
Flake8 expects the result of running these plugins to be an iterable of tuples,
|
|Flake8| expects the result of running these plugins to be an iterable of
|
||||||
each of which contain the following:
|
tuples, each of which contain the following:
|
||||||
|
|
||||||
* An ``int`` with the line number where the issue appears
|
* An ``int`` with the line number where the issue appears
|
||||||
|
|
||||||
|
|
@ -65,7 +66,7 @@ A Physical Line plugin must be callable, it must take a parameter called
|
||||||
``physical_line`` and it must return the result of checking the passed physical
|
``physical_line`` and it must return the result of checking the passed physical
|
||||||
line.
|
line.
|
||||||
|
|
||||||
Flake8 expects the result of this call to be an iterable of tuples, each
|
|Flake8| expects the result of this call to be an iterable of tuples, each
|
||||||
containing the following:
|
containing the following:
|
||||||
|
|
||||||
* An ``int`` with the offset within the line where the reported issue appears
|
* An ``int`` with the offset within the line where the reported issue appears
|
||||||
|
|
@ -80,7 +81,7 @@ A Logical Line plugin must be callable, it must take a parameter called
|
||||||
``logical_line`` and it must return the result of checking the passed logical
|
``logical_line`` and it must return the result of checking the passed logical
|
||||||
line.
|
line.
|
||||||
|
|
||||||
Flake8 expects the result of this call to be an iterable of tuples, each
|
|Flake8| expects the result of this call to be an iterable of tuples, each
|
||||||
containing the following:
|
containing the following:
|
||||||
|
|
||||||
* An ``int`` with the offset within the logical line where the reported issue
|
* An ``int`` with the offset within the logical line where the reported issue
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
Developing a Formatting Plugin for Flake8
|
Developing a Formatting Plugin for Flake8
|
||||||
===========================================
|
===========================================
|
||||||
|
|
||||||
|Flake8| allowes for custom formatting plugins since version
|
|Flake8| allows for custom formatting plugins since version
|
||||||
3.0.0. Let's write a plugin together:
|
3.0.0. Let's write a plugin together:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue