当前位置: 首页 > 知识库问答 >
问题:

违规插件使用错误路径查找pep8报告

万俟玉书
2023-03-14
py.test --pep8 --junitxml=reports\pep8.log

我设置了一个作业来在Reports\pep8.log中查找pep8.log文件

但当我运行该作业时,我发现违规插件查找报告的路径没有意义:

生成的xml文件:C:\jenkins\jobs\python-template-2\workspace\reports\pep8.log===========================================================================

C:\jenkins\jobs\python-template-2\workspace>exit 1构建步骤“IZHESOLVISHENTERCHANGER,HIZHEARBING”将构建标记为失败错误:Publisher hudson.plugins.violations.violationspublisher由于异常而中止)在java.io.FileOutputStream.Open(本机方法)在java.io.FileOutputStream(未知源)在java.io.FileOutputStream(未知源)在hudson.filePath.Write(FilePath.java:1642)hudson.plugins.violations.generate.execute(execute)在hudson.plugins.violations.generate.execute(execute)在hudson.plugins.violations.generate.execute(execute)在hudson.plugins.violations.generate.execute(execute(execute)在sCollector.java:25)在hudson.filePath.act(FilePath.java:912)在hudson.filePath.act(FilePath.java:885)在hudson.plugins.violations.violationspublisher.perform(violationspublisher.java:74)在hudson.tasks.buildstepMonitor$3。在hudson.tasks.buildstepMonitor.45)在hudson.model.abstractbuild$abstractbuildexecution.perform(abstractbuild$abstractbuildexecution.781)在hudson.model.abstractbuild$abstractbuildexecution.performallbuildsteps(abstractbuild.java:753)在abstractbuild$abstractbuildexecution.post(abstractbuild.java:706)在hudson.model.run.execute(run.java:1690)在hudson.model.freestylebuild.run(freestylebuild.java:46)在hudson.model.resourcecontroller.execute(resourcecontroller.java:88)在hudson.model.executor.run(executor.java:230)完成:失败

另外,我尝试在不使用pytest的情况下启动pep8检查,而是使用此命令用于windows查找并检查所有.py文件:

FOR /R %i IN (*.py) DO pep8 %i  1>>reports\pep8.log 

在这种情况下,我得到以下内容:

C:\jenkins\jobs\python-template-2\workspace>exit 1构建步骤'direflowersistentresignorgeng.,heighlinghaptain''将构建标记为失败错误:Publisher hudson.plugins.violations.violationspublisher由于异常而中止java.io.fileNotfoundexception:C:\jenkins\jobs\python-template-2\Build\2013-10-15_13-31-37\violations\file\C:\jenkins\jobs\python-template\python-template\python-template\python-template\notifications\email.py.xml(FileOutputStream.(未知源)在java.io.FileOutputStream.(未知源)在Hudson.FilePath.Write(FilePath.java:1666)在Hudson.plugins.violations.generate.executeFilePath.execute(executeFilePath.java:40)在Hudson.plugins.violations.generate.generate.execute(executeFilePath.java:47)在Hudson.plugins.violations.violationscollector.invoke(violationscollector.java:122)在java:916)在hudson.filePath.act(FilePatH.java:889)在hudson.plugins.violations.violationspublisher.perform(violationspublisher.java:74)在hudson.tasks.buildstepMonitor.45)在hudson.model.abstractbuild$abstractbuildexecution.perform(abstractbuild.java:786)在hudson.model.abstractbuild$abstractbuildexecution.performallbuildsteps(abstractbuild.java:758)在hudson.model.build$buildexecution.post2(build.java:183)在hudson.model.run.execute(run.java:1690)在hudson.model.freestylebuild.run(freestylebuild.java:46)在hudson.model.resourcecontroller.execute(resourcecontroller.java:88)在hudson.model.executor.run(executor.java:246)完成:失败

共有1个答案

程赞
2023-03-14
with open('.\pylint_report.xml', 'r') as lint_file:
    out = ''.join([line.replace('E:\\Jenkins\workspace\\', '')
                   for line in lint_file.readlines()])

with open('.\pylint_report.xml', 'w') as lint_file:
    lint_file.write(out)
 类似资料:
  • 我正在学习bfs/dfs,并试图解决这个问题。有一个n×n的网格。找到在网格中从源单元格移动到目标单元格所需的路径(不一定是最短路径),并返回这些单元格之间的路径。每个网格单元格都有一个值。我们可以一次向四个方向移动一步:上、下、左、右。我们只能移动到具有相等或较小值的相邻单元格。如果没有移动可能到达目标,则返回无。目标在右下角,起点在左上角 下面是我的解决方案,但似乎结果与输出结果混合在一起。任

  • 这意味着什么,我如何搜索我的字符串?

  • 问题内容: 在Java中,序列化使读取和写入对象到流变得非常容易。例如,以下代码片段大部分是将对象写入流所需要的: 只要的类实现了接口,并且所有的非成员变量也都是,这将很好地工作。换句话说,您尝试通过引用发送的整个对象层次结构必须为。假定此代码的唯一问题是内部没有。 如果层次结构不完全,则调用会引发。一切都很好,除了Exception并不能为您提供快速解决问题所需的全部功能。它会告诉您哪些类无法序

  • 我正在为使用ANTLR4的某种语言开发一个小型IDE,当lexer无法匹配错误字符时,我需要在错误字符下划线。在这种情况下,内置的实现向stderr输出一条消息,类似于如下所示: 我完全可以理解如何获得关于错误的行和列的信息(作为参数传递给回调),但如何在回调中获得字符串? 当解析器是错误的来源时,它会将违规令牌作为回调的第二个参数传递,因此提取关于错误输入的开始和停止偏移量的信息变得很简单,参考

  • 我试图用依赖项混淆jar(尽管如果我将常规的单个jar设置为infle,同样的问题也会影响)。 我使用的是Java8,但我必须使用更新版本的Proguard和Proguard Maven插件,因为它涵盖了一些来自更高版本的jar依赖项(否则我会遇到“不支持的主要-次要版本”问题)。 当执行“mvn clean install”时,执行该步骤,但我得到一个“在pluginArtifacts中找不到p

  • 当我试图运行Grails Jasper插件演示页面中的任何演示报告时,我得到了一个错误。我想我错过了一些配置,但插件文档没有给出更多的细节。