python - pylint 或 flake8 的声明性 Jenkins 管道语法
问题描述
有人可以帮助我使用 Violation 插件的声明性语法或用于 pylint 的警告下一代插件吗
我正在使用以下语法。但它没有生成任何图表
sh 'python3 -m pylint --fail-under=4.5 <module> <module> --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" > pylint.log || echo "pylint exited with $?"'
echo "linting Success, Generating Report"
warningsParsers canComputeNew: false, canResolveRelativePaths: false, defaultEncoding: '', excludePattern: '', healthy: '', includePattern: '', messagesPattern: '', parserConfigurations: [[parserName: 'PyLint', pattern: '*']], unHealthy: ''
解决方案
我使用以下语法来解决问题
sh 'python3 -m pylint --output-format=parseable --fail-under=<threshold value> module --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" | tee pylint.log || echo "pylint exited with $?"'
echo "linting Success, Generating Report"
recordIssues enabledForFailure: true, aggregatingResults: true, tool: pyLint(pattern: 'pylint.log')
推荐阅读
- mysql - 在 MySql 表中加载具有唯一 ID 的 mysql 中的每个文件
- javascript - 如何从 json 文件中读取对象 URI(JSON 文件)
- android - 如何使数据绑定与 xml 属性一起工作?
- javascript - D3 无法导入数据中指定的自定义 id 的 json 数据
- matlab - 两个代码有什么区别?
- docker - docker search: x509: 无法加载系统根目录并且没有提供根目录
- azure - 构建器拒绝 Azure DevOps CI 拉取访问,存储库不存在或可能需要“docker login”
- java - 如何在 Java 的 Arraylist 中访问 Object[] 中的值
- javascript - for循环中的Javascript异步/等待
- powershell - 找不到路径“_____”,因为它不存在