NB: Should work with Python 3.7. May not work with later (or earlier) versions, as Python's abstract syntax may change from version to version.
Inspired by numdoclint
,
but wanting to try a slightly different approach...
Specifically, instead of trying to parse signatures and docstrings using
regex, numdoclinter
uses the abstract syntax tree built into Python's
standard library ast
package.
Basically, all we do is:
- recurse through folders to parse modules and list functions,
- parse function signatures and type annotations,
- parse function docstrings,
- check that the signature and docstring are consistent and contain everything required.
You can clone this repo and then pip install
it, and then you can run
numdoclinter
(or just ndlinter
) from your command line on whatever
folder you like.
git clone https://github.com/peterprescott/numdoclinter
cd numdoclinter
pip install .
ndlinter --help