我的pyBuild运行似乎没有运行linter插件。 我可以使用
use_plugin("python.distutils")
或
use_plugin("python.flake8")
,但是当pyBuilder运行完成时,它说: 任务:准备[2073 ms] compile_sources [0 ms] run_unit_tests [504 ms]包[460 ms] run_integration_tests [0 ms] 验证[0 ms ] 发布[2164毫秒]
完整的build.py文件:
from pybuilder.core import use_plugin, init
use_plugin("python.core")
use_plugin("python.pylint")
use_plugin("python.install_dependencies")
use_plugin("pypi:pybuilder_pytest")
use_plugin("pypi:pybuilder_pylint_extended")
#use_plugin("pypi:pybuilder_pytest_coverage")
use_plugin("python.distutils")
default_task = "publish"
@init
def initialize(project):
project.author = "DellEMC"
project.name = "RPCenter"
project.set_property('dir_source_main_python', '..\..\services')
project.get_property("pytest_extra_args").append("-x")
project.set_property('dir_source_pytest_python', '..\..\services')
#project.set_property('pytest_coverage_break_build_threshold', 75)
project.set_property('pylint_options', '["--rcfile=pylintrc.txt", "--reports=n", "../../services"]')
有什么想法吗?
谢谢。
答案 0 :(得分:1)
我遇到了完全相同的问题,并在issue #652中向pybuilder
问题跟踪器寻求帮助。
我一直引用answered
Flake8效果很好。但是,它已注册为默认不执行的分析任务
因此,只需使用启用analyze
任务的命令来运行构建,您的flake8
lint将被执行,如下所示:
$ pyb analyze -vvv
PyBuilder version 0.11.17
Build started at 2019-11-23 13:22:04
------------------------------------------------------------
[INFO] Building pybflake8 version 1.0.dev0
[INFO] Executing build in /Users/marekyggdrasil/projects/pybflake8
[INFO] Going to execute task analyze
[INFO] Executing flake8 on project sources.
[WARN] flake8: src/main/python/run.py:2:121: E501 line too long (345 > 120 characters)
------------------------------------------------------------
BUILD FAILED - flake8 found 1 warning(s)
------------------------------------------------------------
Build finished at 2019-11-23 13:22:06
Build took 1 seconds (1627 ms)