twisted / pydoctor

This is pydoctor, an API documentation generator that works by static analysis.
https://pydoctor.readthedocs.io
Other
180 stars 48 forks source link

Spell checker for docstrings #352

Open mthuurne opened 3 years ago

mthuurne commented 3 years ago

It would be a useful feature to have a spell check option for docstrings. Besides better readability, correct spelling also improves matches when doing a full-text search (another useful feature we don't have yet).

It's not as simple as it sounds though: to avoid false positives, we'd have to exclude for example class/function/variable names, but how those are embedded in docstrings differs per documentation format.

The original context and more discussion on how this could be implemented are in this post.

tristanlatr commented 2 years ago

This can easily be implemented as an extension. Now the question is how to handle optional extensions? Because I suppose we don’t want to see the spelling warning unless we asked for it.

We can bundle bunch of optional extensions within pydoctor and enable them with a command line option. This command line option could point to the full name of the extension module, so for instance —extension=pydoctor.extensions.opt.spelling. We can also support custom extensions this way.