用于检查python源文件以确保正确文档的实用程序。列出缺少的docstring,并计算docstring的总体覆盖率百分比
docstr-coverage的Python项目详细描述
docstr coverage
===
如果您的文档的健康状况处于困境,“docstr coverage”现在就可以看到您了。
“docstr coverage”是一个简单的工具,让您可以测量python源代码的
[docstring]覆盖率(http://www.python.org/dev/pep s/pep-0257/what-is-a-docstring)。它可以显示哪些函数、类、方法和模块没有docstring。它还提供了单个
文件的总体docstring覆盖率的统计信息,以及整个项目。
**source:**https://github.com/huntermcgushion/docstr-coverage
**documentation:**[https://docstr-coverage.readthedocs.io](https://docstr-coverage.readthedocs.io/en/latest/api-essentials.html)
example
----
````
>>huntermcgushion$docstr coverage/docstr庘coverage/
file:“docstr庘coverage/setup.py”
-没有模块docstring
-没有“readme”所需的docstring
文件:“docstr庘coverage/docstr庘coverage/
-没有模块docstring
需要的docstring:1;找到的:0;缺少的:1;覆盖率:0.0%
文件:“docstr_coverage/docstr_coverage/coverage.py”
-没有“docstringcoveragevisitor”的docstring。需要的初始值:11;找到的值:10;缺少的值:1;覆盖率:90.9%
3个文件的总体统计信息:
需要的docstrings:14;找到的docstrings:10;缺少的docstrings:4
总docstring覆盖率:71.4%;等级:非常好,如何使用?
-------
只需提供目录“some-project/src”代替:
``````
$docstr覆盖some-project/src
`````
```````````````````````````````
-skipmagic,-m*-忽略所有的魔术方法(如`````` uu init `,和``` uuu str ``````````````````````````````````````````````````````````文件数量)
**--排除=\<;regex\>;,-e\<;regex\>;*-要从分析中排除的文件路径模式
*要排除虚拟环境“env”和“tests”目录的内容,请运行:
<;br>;```$docstr coverage some_project/-e“env/*”tests/*“```
**--verbose=\<;level\>;,-v\<;level\>;*-设置详细级别(0-3)
*0-静音
*1-打印总体统计信息
*2-同时打印每个文件的个别统计信息
*3-还打印缺少的文档字符串(函数名、类名,等等)
'some-dir/file\u 1.py'])
````
br/>*有关“获取文档字符串覆盖率”及其参数的详细信息,请参阅其[文档](https://docstr coverage.readthedocs.io/en/latest/api_u essentials.html_get docstring coverage)
请参阅“get docstring”coverage[文档](https://docstr coverage.readthedocs.io/en/latest/api_Essentials.html getdocstring coverage)
----
*完整的文档对于帮助其他人(甚至您自己)理解您的代码非常重要
*作为一名开发人员,提高代码的可维护性,以便在需要进行更新和修复错误时,
*作为一名用户,立即知道理解一个新的库
*如果它的文档覆盖率很低,您可能需要自己解决很多问题
运行:
```
pip install git+https://github.com/huntermcgushion/docstr廑coverage.git
````
Special Thanks
——
感谢alexey“datagreed”strelkov和james harlow所做的所有努力。
“docstr coverage”只不过是重新启动,并将他们的精力投入到python 3中。有关详细信息,请参阅“thanks.txt”。
===
如果您的文档的健康状况处于困境,“docstr coverage”现在就可以看到您了。
“docstr coverage”是一个简单的工具,让您可以测量python源代码的
[docstring]覆盖率(http://www.python.org/dev/pep s/pep-0257/what-is-a-docstring)。它可以显示哪些函数、类、方法和模块没有docstring。它还提供了单个
文件的总体docstring覆盖率的统计信息,以及整个项目。
**source:**https://github.com/huntermcgushion/docstr-coverage
**documentation:**[https://docstr-coverage.readthedocs.io](https://docstr-coverage.readthedocs.io/en/latest/api-essentials.html)
example
----
````
>>huntermcgushion$docstr coverage/docstr庘coverage/
file:“docstr庘coverage/setup.py”
-没有模块docstring
-没有“readme”所需的docstring
文件:“docstr庘coverage/docstr庘coverage/
-没有模块docstring
需要的docstring:1;找到的:0;缺少的:1;覆盖率:0.0%
文件:“docstr_coverage/docstr_coverage/coverage.py”
-没有“docstringcoveragevisitor”的docstring。需要的初始值:11;找到的值:10;缺少的值:1;覆盖率:90.9%
3个文件的总体统计信息:
需要的docstrings:14;找到的docstrings:10;缺少的docstrings:4
总docstring覆盖率:71.4%;等级:非常好,如何使用?
-------
只需提供目录“some-project/src”代替:
``````
$docstr覆盖some-project/src
`````
```````````````````````````````
-skipmagic,-m*-忽略所有的魔术方法(如`````` uu init `,和``` uuu str ``````````````````````````````````````````````````````````文件数量)
**--排除=\<;regex\>;,-e\<;regex\>;*-要从分析中排除的文件路径模式
*要排除虚拟环境“env”和“tests”目录的内容,请运行:
<;br>;```$docstr coverage some_project/-e“env/*”tests/*“```
**--verbose=\<;level\>;,-v\<;level\>;*-设置详细级别(0-3)
*0-静音
*1-打印总体统计信息
*2-同时打印每个文件的个别统计信息
*3-还打印缺少的文档字符串(函数名、类名,等等)
'some-dir/file\u 1.py'])
````
br/>*有关“获取文档字符串覆盖率”及其参数的详细信息,请参阅其[文档](https://docstr coverage.readthedocs.io/en/latest/api_u essentials.html_get docstring coverage)
请参阅“get docstring”coverage[文档](https://docstr coverage.readthedocs.io/en/latest/api_Essentials.html getdocstring coverage)
----
*完整的文档对于帮助其他人(甚至您自己)理解您的代码非常重要
*作为一名开发人员,提高代码的可维护性,以便在需要进行更新和修复错误时,
*作为一名用户,立即知道理解一个新的库
*如果它的文档覆盖率很低,您可能需要自己解决很多问题
运行:
```
pip install git+https://github.com/huntermcgushion/docstr廑coverage.git
````
Special Thanks
——
感谢alexey“datagreed”strelkov和james harlow所做的所有努力。
“docstr coverage”只不过是重新启动,并将他们的精力投入到python 3中。有关详细信息,请参阅“thanks.txt”。