API Reference

In addition to the Flake8 plugin, the following public API is available to allow other plugins to build on top of flake8-sphinx-links.

Classes:

Plugin(tree)

Flake8 plugin to check docstrings for double backticked strings which should be links to the Python documentation.

Visitor()

AST visitor to check docstrings for double backticked strings which should be links to the Python documentation.

Data:

exc

List of keywords which should become :py:exc:`<keyword>`

py_obj

List of keywords which should become :py:obj:`<keyword>`

py_obj_python

List of keywords that should become :py:obj:`python:<keyword>` to prevent conflict with Sphinx objects.

regex

Regex to match keywords that should be Sphinx links.

class Plugin(tree)[source]

Bases: Plugin[Visitor]

Flake8 plugin to check docstrings for double backticked strings which should be links to the Python documentation.

class Visitor[source]

Bases: Visitor

AST visitor to check docstrings for double backticked strings which should be links to the Python documentation.

exc = ['BaseException', 'Exception', 'ArithmeticError', 'BufferError', 'LookupError', 'AssertionError', 'AttributeError', 'EOFError', 'FloatingPointError', 'GeneratorExit', 'ImportError', 'ModuleNotFoundError', 'IndexError', 'KeyError', 'KeyboardInterrupt', 'MemoryError', 'NameError', 'NotImplementedError', 'OSError', 'OverflowError', 'RecursionError', 'ReferenceError', 'RuntimeError', 'StopIteration', 'StopAsyncIteration', 'SyntaxError', 'IndentationError', 'TabError', 'SyntaxError', 'IndentationError', 'TabError', 'SystemError', 'SystemExit', 'TypeError', 'UnboundLocalError', 'UnicodeError', 'UnicodeEncodeError', 'UnicodeDecodeError', 'UnicodeTranslateError', 'ValueError', 'ZeroDivisionError', 'EnvironmentError', 'IOError', 'WindowsError', 'BlockingIOError', 'ChildProcessError', 'ConnectionError', 'BrokenPipeError', 'ConnectionAbortedError', 'ConnectionRefusedError', 'ConnectionResetError', 'FileExistsError', 'FileNotFoundError', 'InterruptedError', 'IsADirectoryError', 'NotADirectoryError', 'PermissionError', 'ProcessLookupError', 'TimeoutError', 'Warning', 'UserWarning', 'DeprecationWarning', 'PendingDeprecationWarning', 'SyntaxWarning', 'RuntimeWarning', 'FutureWarning', 'ImportWarning', 'UnicodeWarning', 'BytesWarning', 'ResourceWarning']

Type:    List[str]

List of keywords which should become :py:exc:`<keyword>`

py_obj = ['True', 'False', 'None', 'NotImplemented', 'Ellipsis', '__debug__', 'quit', 'exit', 'credits', 'license']

Type:    List[str]

List of keywords which should become :py:obj:`<keyword>`

py_obj_python = ['copyright']

Type:    List[str]

List of keywords that should become :py:obj:`python:<keyword>` to prevent conflict with Sphinx objects.

regex

Type:    Pattern

Regex to match keywords that should be Sphinx links.