Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure supported directives #25

Open
AA-Turner opened this issue Apr 26, 2022 · 1 comment · May be fixed by #26
Open

Configure supported directives #25

AA-Turner opened this issue Apr 26, 2022 · 1 comment · May be fixed by #26

Comments

@AA-Turner
Copy link
Member

A brief look through the source, I saw the list of directive names is hardcoded and contains many specific to the CPython docs:

sphinx-lint/sphinxlint.py

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

@AA-Turner
Copy link
Member Author

Turns out the second part of this is basically #1, sorry! I think the first part is still useful as a stand-alone issue.

A

@AA-Turner AA-Turner linked a pull request Apr 27, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant