从ViolationConfig中发现0个冲突

2024-06-16 11:19:05 发布

您现在位置:Python中文网/ 问答频道 /正文

我设置了一个Jenkins CI服务器,用rubocop分析ruby代码,然后在github上发布pull请求中的冲突。你知道吗

我有PEP8的工作,但也想发表意见,以github。。。有没有什么程序可以像pronto rubocop那样做呢?你知道吗

更新1:

我正试图在我的Jenkins构建脚本(executeshell)中使用以下命令,在Ubuntu中使用pep8实用程序配置Jenkins服务器来扫描我的项目:

pep8 testing/ > pep8.out

接下来,我使用违规插件并在XML文件名模式下输入“pep8.out”。这非常适合我整个项目的结果

但是,我只想扫描pull请求中对styl冲突的更改,因此我使用GitHub插件的冲突注释来执行此任务。你知道吗

当我使用github pull request builder插件时,我输入了这个作为我的pull request ID:

${ghprbPullId}

接下来,我选中“Comment only changed part of files”框,并将“pep8.out”作为我的模式放在“FLAKE8”选项旁边。据我所知,PEP8和FLAKE8应该是交叉兼容的。你知道吗

有很多违规行为应该在开箱即用的情况下检测出来(例如,我使用的是2个空格,而不是python3的4个空格)。这应该在我的样品请求中被标记。但我在控制台中看到以下输出:

 ---
--- Jenkins Violation Comments to GitHub ---
---
pullRequestId: 83
usernamePasswordCredentialsId: false
username: false
password: false
createSingleFileComments: false
createCommentWithAllSingleFileComments: true
commentOnlyChangedContent: true
CHECKSTYLE with pattern 
CSSLINT with pattern 
LINT with pattern pylint.out
FINDBUGS with pattern 
JSHINT with pattern 
PMD with pattern 
CPPCHECK with pattern 
RESHARPER with pattern 
FLAKE8 with pattern ./pep8.out
CPPLINT with pattern 
XMLLINT with pattern 
PERLCRITIC with pattern 
PITEST with pattern 
ANDROIDLINT with pattern 
Running Jenkins Violation Comments To GitHub
Will comment 83
Workspace: /var/lib/jenkins/workspace/Project Style Checks
Found 0 violations from ViolationConfig [pattern=./pep8.out, reporter=FLAKE8].

(我已经删除了任何可能的私人文本,但这应该能让我对看到的内容有一个很好的了解)

当我深入查看日志时,我也发现了这个错误。TBH不确定是否相关:

java.lang.NullPointerException: GitHubUrl
    at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:204)
    at se.bjurr.violations.comments.github.lib.ViolationCommentsToGitHubApi.checkState(ViolationCommentsToGitHubApi.java:170)
    at se.bjurr.violations.comments.github.lib.ViolationCommentsToGitHubApi.toPullRequest(ViolationCommentsToGitHubApi.java:155)
    at org.jenkinsci.plugins.jvctg.perform.JvctgPerformer.doPerform(JvctgPerformer.java:103)
    at org.jenkinsci.plugins.jvctg.perform.JvctgPerformer$1.invoke(JvctgPerformer.java:138)
    at org.jenkinsci.plugins.jvctg.perform.JvctgPerformer$1.invoke(JvctgPerformer.java:125)
    at hudson.FilePath.act(FilePath.java:1018)
    at hudson.FilePath.act(FilePath.java:996)
    at org.jenkinsci.plugins.jvctg.perform.JvctgPerformer.jvctsPerform(JvctgPerformer.java:125)
    at org.jenkinsci.plugins.jvctg.ViolationsToGitHubRecorder.perform(ViolationsToGitHubRecorder.java:60)
    at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
    at hudson.model.Build$BuildExecution.post2(Build.java:185)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665)
    at hudson.model.Run.execute(Run.java:1766)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:410)

Tags: orggithubmodelwithjavaoutperformat