如何在Aptana3中添加Python代码的PEP8检查?我不能像在eclipse中那样添加。
发布于 2013-11-20 17:54:24
请参阅this
它描述了如何将pep8检查集成到eclipse中,并且还为aptana studio提供了一节。
这就是本文所涉及的内容(以防链接中断):
Buildout
我使用buildout在我的${buildout: directory }/bin目录中生成了一个pep8检查二进制文件。我现在可以从命令行使用它,也可以从eclipse中作为外部程序员运行它。
[buildout]
parts =
...
pep8
...
[pep8]
recipe = zc.recipe.egg
eggs = pep8
entry-points = pep8check=pep8:_main
dirs = ['src/my.product', ]
scripts = pep8check
initialization = sys.argv.extend(${pep8:dirs})在(重新)运行buildout之后,您的bin/文件夹中应该有一个pep8check可执行文件。
daniel:~/sandbox/project/ $ ls -l bin/ | grep pep8
-rwxr-xr-x 1 daniel staff 408 22 Mar 17:29 pep8check执行此文件将对-product.package中的每个文件运行pep8检查。
daniel:~/sandbox/project/ $ bin/pep8check
src/my.product/my/product/expiration.py:26:50: E261 at least two spaces before inline comment
src/my.product/my/product/expiration.py:47:5: E303 too many blank lines (2)
src/my.product/my/product/logger.py:18:17: E202 whitespace before '}'
src/my.product/my/product/logger.py:49:1: W291 trailing whitespace使用直接eclipse集成的
main menu Run->External Tools->External Tools Configuration).如果您使用的是与我上面发布的相同的构建配置,则应该使用${project_loc}/bin/pep8check for executable and ${project_loc}作为工作目录。
使用Aptana Studio3.0的
Aptana Studio3.0附带了pydev和许多其他工具,pep8也包括在内。这为您提供了一种更舒适的方式来启用pep8检查,因为您在开发代码时可以看到代码分析结果。
我希望这能帮到你。
https://stackoverflow.com/questions/19563304
复制相似问题