pylint \ flake8 插件不会 运行 来自 pyBuilder

pylint \ flake8 plugins won't run from pyBuilder

我的 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"]')

有什么想法吗?

谢谢。

我遇到了完全相同的问题,并在 issue #652 中到达 pybuilder 问题跟踪器寻求帮助。

原样answered我引用

Flake8 works quite well. It is however is registered as an analyze task which is not executed by default

因此,只需 运行 您使用启用 analyze 任务的命令构建,您的 flake8 linting 将被执行,如下所示:

$ 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)