我希望codesniffer在CLI中生成错误输出,并在继续之前退出,以避免运行其他测试,如behat、phpmd、phpcpd,以便以后再运行。
当前代码(如下面所示)创建一个XML报告,其中列出了错误,但它不会终止这个过程。如何修改代码以获得XML报告、CLI错误输出并在发生错误时终止进程?
PHING中的当前代码:
<target name="codesniffer-phpcs">
<echo msg="Checking coding standards ..." />
<tstamp />
<phpcodesniffer standard="PSR2" showWarnings="true" format="full">
<fileset refid="sourcecode" />
<formatter type="checkstyle" outfile="phing/phpcs/psr2_${DSTAMP}-${TSTAMP}.xml" />
</phpcodesniffer>
</target>--这是我希望在CLI中看到的,以及XML文件:
FOUND 4 ERROR(S) AFFECTING 4 LINE(S)
--------------------------------------------------------------------------------
69 | ERROR | There must not be more than one property declared per statement
108 | ERROR | The abstract declaration must precede the visibility
657 | ERROR | Expected 1 space after comma in function call; 2 found
812 | ERROR | A cast statement must be followed by a single space
--------------------------------------------------------------------------------发布于 2014-10-18 20:44:31
我认为任务中的属性"haltonerror“将是您在这里的朋友。http://www.phing.info/docs/guide/stable/apcs48.html
https://stackoverflow.com/questions/26141021
复制相似问题