浏览:python静态分析工具
prospector-fixes-232的Python项目详细描述
探矿者图片::https://img.shields.io/pypi/v/prospector.svg
:目标:https://pypi.python.org/pypi/prospector
:alt:prospector的最新版本
…图片:https://travis-ci.org/landscapeio/prospector.png?branch=master
:目标:https://travis ci.org/landscapeio/prospector
:alt:build status
。图片::https://landscape.io/github/landscapeio/prospector/master/landscape.png?style=flat
:目标:https://landscape.io/github/landscapeio/prospector/master
:alt:code health
。图片::https://img.shields.io/covertalls/landscapeio/prospector.svg?style=flat
:目标:https://coveralls.io/r/landscapeio/prospector
:alt:测试覆盖率
。图片::https://readthedocs.org/projects/prospector/badge/?version=latest
:target:http://prospector.landscape.io/
:alt:documentation
about
----
prospector是一个分析python代码并输出有关
错误、潜在问题、违反约定和复杂性的信息的工具。
其他python分析工具的功能,如
`pylint<;http://docs.pylint.org/>;` `、
`pep8<;http://pep8.readthedocs.org/en/latest/>;` ` ` `、
和`mccabe complexity<;https://pypi.python.org/pypi/mccabe>;` ` ` `.
请参阅"支持的工具"<;http://prospector.landscape.io/en/master/supported_tools.html>;` `完整列表的文档部分。
prospector的主要目标是"开箱即用"。其他
python分析工具的一个常见抱怨是,筛选与
相关或与您自己的编码风格相关的错误需要很长时间。prospector提供了一些默认配置文件,希望它能提供一个很好的起点,并且很快就会有用,并根据项目使用的库调整输出。
通过运行以下命令,可以使用"pip"安装"prospector":
prospector的可选依赖项,例如"pyroma"也可以通过运行以下命令来安装:
有关所有可选依赖项的列表,请参阅"支持的工具"lt上的"阅读文档"页上的"可选附加功能"部分;https://prospector.landscape.io/en/latest/supported廑tools.html廑optional extras>;`廑.
有关安装该工具的详细信息,请参阅安装部分http://prospector.landscape.io/en/latest/廑installation>;`工具主页上的"ReadtheDocs"。
文档
----
完整文档可在ReadtheDocs<;http://prospector.landscape.io>;`.
用法
----
只需从项目的根目录运行prospector::
这将输出指出潜在问题或错误的消息列表,例如::
prospector.tools.base(prospector/tools/base.py):
l5:0 toolbase:pylint-r0922
抽象类只被引用了1次
options
````````````
run``prospector--help``以获取选项及其效果的完整列表。
outputformat
~~~~~~~~~~~~~~~~~~~
``prospector``的默认输出格式设计为可读。对于解析
(例如,对于报告),可以使用`--output format json``标志获取json格式化的
输出。
~~~~~~~
禁用或启用工具或消息的指令。有关详细信息,请阅读有关配置文件的文档http://prospector.landscape.io/en/latest/profiles.html>;` `.
例如,pylint可以在代码中查找非错误的错误,例如,由于项目使用的库或框架在运行时创建的类的属性。
例如,在默认情况下,pylint在访问"objects"时将为django模型生成错误,由于
``objects``属性不属于``model``类定义的一部分。
prospector通过向底层工具提供对这些框架的理解来缓解这种情况。
prospector将尝试通过
`detecting dependencies<直观地了解项目使用的库;https://github.com/landscapeio/requirements detector>;``并自动打开对必需库的支持。您可以在报表的元数据部分中看到运行了哪些适配器。
如果prospector没有正确检测到项目的依赖项,则可以从命令行中手动指定它们:
prospector--使用django celeri
如果prospector正在自动检测您实际上不使用的库,则可以完全关闭自动检测::
prospector--no autodetect
请注意,这些适配器已尽可能编写为底层工具的插件或扩展,因此不需要探矿者就可以使用。例如,Django支持作为Pylint插件可用。
strictness
~~~~~~~~~~~
prospector--strictness high
可能的值为"verylow",`` low``,``medium`,``high`,``veryhigh`。
prospector默认情况下不包含文档警告,但您可以使用``--doc warnings``标志打开此功能。
license
----
prospector在gplv2许可下可用。
:目标:https://pypi.python.org/pypi/prospector
:alt:prospector的最新版本
…图片:https://travis-ci.org/landscapeio/prospector.png?branch=master
:目标:https://travis ci.org/landscapeio/prospector
:alt:build status
。图片::https://landscape.io/github/landscapeio/prospector/master/landscape.png?style=flat
:目标:https://landscape.io/github/landscapeio/prospector/master
:alt:code health
。图片::https://img.shields.io/covertalls/landscapeio/prospector.svg?style=flat
:目标:https://coveralls.io/r/landscapeio/prospector
:alt:测试覆盖率
。图片::https://readthedocs.org/projects/prospector/badge/?version=latest
:target:http://prospector.landscape.io/
:alt:documentation
about
----
prospector是一个分析python代码并输出有关
错误、潜在问题、违反约定和复杂性的信息的工具。
其他python分析工具的功能,如
`pylint<;http://docs.pylint.org/>;` `、
`pep8<;http://pep8.readthedocs.org/en/latest/>;` ` ` `、
和`mccabe complexity<;https://pypi.python.org/pypi/mccabe>;` ` ` `.
请参阅"支持的工具"<;http://prospector.landscape.io/en/master/supported_tools.html>;` `完整列表的文档部分。
prospector的主要目标是"开箱即用"。其他
python分析工具的一个常见抱怨是,筛选与
相关或与您自己的编码风格相关的错误需要很长时间。prospector提供了一些默认配置文件,希望它能提供一个很好的起点,并且很快就会有用,并根据项目使用的库调整输出。
通过运行以下命令,可以使用"pip"安装"prospector":
prospector的可选依赖项,例如"pyroma"也可以通过运行以下命令来安装:
有关所有可选依赖项的列表,请参阅"支持的工具"lt上的"阅读文档"页上的"可选附加功能"部分;https://prospector.landscape.io/en/latest/supported廑tools.html廑optional extras>;`廑.
有关安装该工具的详细信息,请参阅安装部分http://prospector.landscape.io/en/latest/廑installation>;`工具主页上的"ReadtheDocs"。
文档
----
完整文档可在ReadtheDocs<;http://prospector.landscape.io>;`.
用法
----
只需从项目的根目录运行prospector::
这将输出指出潜在问题或错误的消息列表,例如::
prospector.tools.base(prospector/tools/base.py):
l5:0 toolbase:pylint-r0922
抽象类只被引用了1次
options
````````````
run``prospector--help``以获取选项及其效果的完整列表。
outputformat
~~~~~~~~~~~~~~~~~~~
``prospector``的默认输出格式设计为可读。对于解析
(例如,对于报告),可以使用`--output format json``标志获取json格式化的
输出。
例如,pylint可以在代码中查找非错误的错误,例如,由于项目使用的库或框架在运行时创建的类的属性。
例如,在默认情况下,pylint在访问"objects"时将为django模型生成错误,由于
``objects``属性不属于``model``类定义的一部分。
prospector通过向底层工具提供对这些框架的理解来缓解这种情况。
prospector将尝试通过
`detecting dependencies<直观地了解项目使用的库;https://github.com/landscapeio/requirements detector>;``并自动打开对必需库的支持。您可以在报表的元数据部分中看到运行了哪些适配器。
如果prospector没有正确检测到项目的依赖项,则可以从命令行中手动指定它们:
prospector--使用django celeri
如果prospector正在自动检测您实际上不使用的库,则可以完全关闭自动检测::
prospector--no autodetect
请注意,这些适配器已尽可能编写为底层工具的插件或扩展,因此不需要探矿者就可以使用。例如,Django支持作为Pylint插件可用。
strictness
~~~~~~~~~~~
prospector--strictness high
可能的值为"verylow",`` low``,``medium`,``high`,``veryhigh`。
prospector默认情况下不包含文档警告,但您可以使用``--doc warnings``标志打开此功能。
license
----
prospector在gplv2许可下可用。