使用Jenkins和Php代码嗅探器 [英] Using Jenkins and Php Code Sniffer

查看:104
本文介绍了使用Jenkins和Php代码嗅探器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Jenkins中使用Php Code Sniffer插件. 它会生成一个checkstyle.xml文件,但是里面没有错误,我知道我应该有.

I'm trying to use the Php Code Sniffer plugin in Jenkins. It generates a checkstyle.xml file but there are no errors inside, and I know that I should have.

这是我的checkstyle.xml的内容:

Here's the containt of my checkstyle.xml :

<?xml version="1.0" encoding="UTF-8"?>
<checkstyle version="1.5.0RC2">
</checkstyle>

我对Jenkins的build.xml文件是:

My build.xml file for Jenkins is :

<target name="phpcs" >
  <exec executable="phpcs">
    <arg line="--report=checkstyle 
 --report-file=${project.basedir}/build/logs/checkstyle.xml
 --standard=Zend
 ${project.basedir}/*.php" />
  </exec>
 </target>

当我在命令行中执行此操作时,我得到了不同的结果. 我的命令:

And when i do it in command line, I have a different result. My command :

phpcs --report=checkstyle --report-file=checkstyle.xml --standard=Zend *.php

它会生成没有错误的相同checkstyle.xml和包含错误的phpcs-checkstyle.tmp.

It generates the same checkstyle.xml with no errors, and a phpcs-checkstyle.tmp which contains the errors.

如何在我的checkstyle.xml文件中包含错误的结果?

How can I do to have the results with the errors in my checkstyle.xml file ?

谢谢.

推荐答案

我认为您的问题是您遇到了以下错误:

I think your problem is that you are suffering from this bug: http://pear.php.net/bugs/bug.php?id=19930

该错误仅出现在您使用的RC版本中.

The bug only occurs in the RC version you are using.

恢复到当前的稳定版本(1.4.5)应该可以使您再次正常工作.

Reverting to the current stable version (1.4.5) should get things working again for you.

这篇关于使用Jenkins和Php代码嗅探器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆