问题描述
我正在一个需要Numpy文档的项目中。在我使用Java的日子里,我记得曾在Linux / IDEA中检查过Javadoc遵从性的短毛猫。
I'm working on a project that requires Numpy documentation. In my Java days, I remember having linters that checked for Javadoc adherence in Eclipse/IDEA; is there an equivalent that checks for Numpy documentation style adherence?
我知道PEP257,但似乎没有针对Numpy文档的任何特定检查。
I know about PEP257, but it doesn't seem to have any specific checks for Numpy documentation.
推荐答案
Pylint似乎支持这一点。看看。
Pylint seems to support that. Take a look at pylint.extensions.docparams.
总结一下。您可以通过添加
To sum it up. You activate this checker of pylint by adding
load-plugins=pylint.extensions.docparams
在您的 .pylintrc
的主部分中。
-
参数及其类型
parameters and their types
返回值及其类型
引发的异常
实际上(以前为pep257)。虽然,这并不完美,但我认为它与您要实现的目标最接近,并且在不久的将来可能会有所改善。
Actually pydocstyle (formerly pep257) recently added support for the numpy docstring convention. Although, it's not perfect I think it's the closest to what you want to achieve and it will probably improve in the near future.
pydocstyle --convention=numpy example.py
这篇关于有什么方法可以减少Python文件的数量,以检查Numpy文档样式是否符合要求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!