mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-10 14:54:17 +00:00
Add some notes for users about how to use plugins
This commit is contained in:
parent
c2111656a6
commit
87b331c552
2 changed files with 67 additions and 0 deletions
|
|
@ -24,6 +24,7 @@ This guide will cover all of these and the nuances for using |Flake8|.
|
||||||
configuration
|
configuration
|
||||||
options
|
options
|
||||||
ignoring-errors
|
ignoring-errors
|
||||||
|
using-plugins
|
||||||
python-api
|
python-api
|
||||||
|
|
||||||
.. config files
|
.. config files
|
||||||
|
|
|
||||||
66
docs/source/user/using-plugins.rst
Normal file
66
docs/source/user/using-plugins.rst
Normal file
|
|
@ -0,0 +1,66 @@
|
||||||
|
==================================
|
||||||
|
Using Plugins For Fun and Profit
|
||||||
|
==================================
|
||||||
|
|
||||||
|
|Flake8| is useful on its own but a lot of |Flake8|'s popularity is due to
|
||||||
|
its extensibility. Our community has developed :term:`plugin`\ s that augment
|
||||||
|
|Flake8|'s behaviour. Most of these plugins are uploaded to PyPI_. The
|
||||||
|
developers of these plugins often have some style they wish to enforce.
|
||||||
|
|
||||||
|
For example, `flake8-docstrings`_ adds a check for :pep:`257` style
|
||||||
|
conformance. Others attempt to enforce consistency, like `flake8-future`_.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
The accuracy or reliability of these plugins may vary wildly from plugin
|
||||||
|
to plugin and not all plugins are guaranteed to work with |Flake8| 3.0.
|
||||||
|
|
||||||
|
To install a third-party plugin, make sure that you know which version of
|
||||||
|
Python (or pip) you used to install |Flake8|. You can then use the most
|
||||||
|
appropriate of:
|
||||||
|
|
||||||
|
.. prompt:: bash
|
||||||
|
|
||||||
|
pip install <plugin-name>
|
||||||
|
pip3 install <plugin-name>
|
||||||
|
python -m pip install <plugin-name>
|
||||||
|
python2.7 -m pip install <plugin-name>
|
||||||
|
python3 -m pip install <plugin-name>
|
||||||
|
python3.4 -m pip install <plugin-name>
|
||||||
|
python3.5 -m pip install <plugin-name>
|
||||||
|
|
||||||
|
To install the plugin, where ``<plugin-name>`` is the package name on PyPI_.
|
||||||
|
To verify installation use:
|
||||||
|
|
||||||
|
.. prompt:: bash
|
||||||
|
|
||||||
|
flake8 --version
|
||||||
|
python<version> -m flake8 --version
|
||||||
|
|
||||||
|
To see the plugin's name and version in the output.
|
||||||
|
|
||||||
|
.. seealso:: :ref:`How to Invoke Flake8 <invocation>`
|
||||||
|
|
||||||
|
After installation, most plugins immediately start reporting :term:`error`\ s.
|
||||||
|
Check the plugin's documentation for which error codes it returns and if it
|
||||||
|
disables any by default.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
You can use both :option:`flake8 --select` and :option:`flake8 --ignore`
|
||||||
|
with plugins.
|
||||||
|
|
||||||
|
Some plugins register new options, so be sure to check :option:`flake8 --help`
|
||||||
|
for new flags and documentation. These plugins may also allow these flags to
|
||||||
|
be specified in your configuration file. Hopefully, the plugin authors have
|
||||||
|
documented this for you.
|
||||||
|
|
||||||
|
.. seealso:: :ref:`Configuring Flake8 <configuration>`
|
||||||
|
|
||||||
|
|
||||||
|
.. _PyPI:
|
||||||
|
https://pypi.io/
|
||||||
|
.. _flake8-docstrings:
|
||||||
|
https://pypi.io/project/flake8-docstrings/
|
||||||
|
.. _flake8-future:
|
||||||
|
https://pypi.io/project/flake8-future/
|
||||||
Loading…
Add table
Add a link
Reference in a new issue