-
-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
A brief look through the source, I saw the list of directive names is hardcoded and contains many specific to the CPython docs:
Lines 87 to 100 in f6a736d
| # Sphinx and Python docs custom ones | |
| 'acks', 'attribute', 'autoattribute', 'autoclass', 'autodata', | |
| 'autoexception', 'autofunction', 'automethod', 'automodule', | |
| 'availability', 'centered', 'cfunction', 'class', 'classmethod', 'cmacro', | |
| 'cmdoption', 'cmember', 'code-block', 'confval', 'cssclass', 'ctype', | |
| 'currentmodule', 'cvar', 'data', 'decorator', 'decoratormethod', | |
| 'deprecated-removed', 'deprecated(?!-removed)', 'describe', 'directive', | |
| 'doctest', 'envvar', 'event', 'exception', 'function', 'glossary', | |
| 'highlight', 'highlightlang', 'impl-detail', 'index', 'literalinclude', | |
| 'method', 'miscnews', 'module', 'moduleauthor', 'opcode', 'pdbcommand', | |
| 'productionlist', 'program', 'role', 'sectionauthor', 'seealso', | |
| 'sourcecode', 'staticmethod', 'tabularcolumns', 'testcode', 'testoutput', | |
| 'testsetup', 'toctree', 'todo', 'todolist', 'versionadded', | |
| 'versionchanged' |
Would it be an idea to limit the list to just Sphinx roles by default, and have some way of adding "known" directive names? This could be via e.g. sphinx-lint.toml or via command line flags.
An extension to this idea would be dumping custom directives from Sphinx through some mechanism, and then having some sphinx-lint init that could use that hook with a project's conf.py to auto-populate. But baby steps!
A
Metadata
Metadata
Assignees
Labels
No labels