有什么方法可以减少Python文件的数量,以检查Numpy文档样式是否符合要求? [英] Is there any way to lint a Python file to check for Numpy documentation style adherence?

查看:104
本文介绍了有什么方法可以减少Python文件的数量,以检查Numpy文档样式是否符合要求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在一个需要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.extensions.docparams

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 的主部分中。


此检查器验证所有函数,方法和构造函数
的文档字符串是否包含

This checker verifies that all function, method, and constructor docstrings include documentation of the


  • 参数及其类型

  • parameters and their types

返回值及其类型

引发的异常






实际上 pydocstyle (以前为pep257)最近增加了对numpy docstring约定的支持。虽然,这并不完美,但我认为它与您要实现的目标最接近,并且在不久的将来可能会有所改善。


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文档样式是否符合要求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆