sphinx-contrib / sphinx-lint

Check for stylistic and formal issues in .rst and .py files included in the documentation
https://pypi.org/project/sphinx-lint/
Other
70 stars 20 forks source link

Configure supported directives #25

Open AA-Turner opened 2 years ago

AA-Turner commented 2 years ago

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

https://github.com/sphinx-contrib/sphinx-lint/blob/f6a736db170cc9b4eef14f0708c4bc01e7b81dd7/sphinxlint.py#L87-L100

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 commented 2 years ago

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