flake8

A Sphinx directive for documenting flake8 codes.

New in version 1.6.0.

Enable sphinx_toolbox.flake8 by adding the following to the extensions variable in your conf.py:

extensions = [
    ...
    'sphinx_toolbox.flake8',
    ]

For more information see https://www.sphinx-doc.org/en/master/usage/extensions#third-party-extensions .

Usage

.. flake8-codes:: plugin

Adds a table documenting a flake8 plugin’s codes.

The directive takes a single argument – the fully qualified name of the flake8 plugin module.

Codes to document are given in the body of the directive.

Example

.. flake8-codes:: flake8_dunder_all

    DALL000

Code

Description

DALL000

Module lacks __all__.

API Reference

class Flake8CodesDirective(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]

Bases: SphinxDirective

A Sphinx directive for documenting flake8 codes.

has_content = True

Type:    bool

required_arguments = 1

Type:    int

setup(app)[source]

Setup sphinx_toolbox.flake8.

Parameters:

app (Sphinx) – The Sphinx application.

Return type:

SphinxExtMetadata