Skip to content

Latest commit

 

History

History
66 lines (47 loc) · 2.17 KB

using-plugins.rst

File metadata and controls

66 lines (47 loc) · 2.17 KB

Using Plugins For Fun and Profit

is useful on its own but a lot of 's popularity is due to its extensibility. Our community has developed plugins that augment '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 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 3.0.

To install a third-party plugin, make sure that you know which version of Python (or pip) you used to install . You can then use the most appropriate of:

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:

bash

flake8 --version python<version> -m flake8 --version

To see the plugin's name and version in the output.

How to Invoke Flake8 <invocation>

After installation, most plugins immediately start reporting errors. Check the plugin's documentation for which error codes it returns and if it disables any by default.

Note

You can use both flake8 --select and flake8 --ignore with plugins.

Some plugins register new options, so be sure to check 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.

Configuring Flake8 <configuration>