Skip to content

Instantly share code, notes, and snippets.

@gwerbin
Last active December 8, 2022 21:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gwerbin/7a981694ae545f228e697058cff00ef3 to your computer and use it in GitHub Desktop.
Save gwerbin/7a981694ae545f228e697058cff00ef3 to your computer and use it in GitHub Desktop.
Flakeheaven config for using flake8-rst-docstrings (https://github.com/peterjc/flake8-rst-docstrings/) with Sphinx
[tool.flakeheaven]
max-line-length = 88
format = 'grouped'
# Options for flake8-rst-docstrings
# https://github.com/peterjc/flake8-rst-docstrings#configuration
rst-roles = [
# Built-in roles
# https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html
'any',
'ref',
'doc',
'download',
'numref',
'envvar',
'token',
'keyword',
'option',
'term',
'code',
'math',
'eq',
'abbr',
'command',
'dfn',
'file',
'guilabel',
'kbd',
'mailheader',
'makevar',
'manpage',
'menuselection',
'mimetype',
'newsgroup',
'program',
'regex',
'samp',
'rfc',
'pep',
# Python domain roles
# https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#cross-referencing-python-objects
':py:mod',
':py:func',
':py:data',
':py:const',
':py:class',
':py:meth',
':py:attr',
':py:exc',
':py:obj',
# If default-domain is set to Python (enabled by default)
'mod',
'func',
'data',
'const',
'class',
'meth',
'attr',
'exc',
'obj',
]
rst-directives = [
# Built-in
# https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html
'toctree',
'note',
'warning',
'versionadded',
'versionchanged',
'deprecated',
'seealso',
'rubric',
'centered',
'hlist',
'highlight',
'literalinclude',
'glossary',
'sectionauthor',
'codeauthor',
'index',
'only',
'tabularcolumns',
'math',
'productionlist',
'default-domain',
# Standard domain
# https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#the-standard-domain
'option',
'envvar',
'program',
'describe',
'object',
# Python domain
# https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#the-python-domain
'module',
'currentmodule',
'function',
'data',
'exception',
'class',
'attribute',
'property',
'staticmethod',
'classmethod',
'decorator',
'decoratormethod',
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment