【问题标题】:pylint \ flake8 plugins won't run from pyBuilderpylint \ flake8 插件不会从 pyBuilder 运行
【发布时间】:2023-04-05 09:44:02
【问题描述】:

我的 pyBuild 运行似乎没有运行任何 linter 插件。 我可以使用任何一个

use_plugin("python.distutils")

use_plugin("python.flake8")

但是当 pyBuilder 运行完成时,它会说: 任务:准备 [2073 ms] compile_sources [0 ms] run_unit_tests [504 ms] package [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"]')

有什么想法吗?

谢谢。

【问题讨论】:

    标签: plugins pylint flake8 pybuilder


    【解决方案1】:

    我遇到了完全相同的问题,并通过issue #652 联系pybuilder 问题跟踪器寻求帮助。

    正如answered我引用的那样

    Flake8 运行良好。但是它被注册为默认不执行的分析任务

    因此,只需使用启用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)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-08-22
      相关资源
      最近更新 更多