Edit report at https://pear.php.net/bugs/bug.php?id=20378&edit=1
ID: 20378
Updated by: [email protected]
Reported By: ferdypruis at gmail dot com
-Summary: Syntax error in XML report file
+Summary: Report appended to existing file if no errors found
in run
Status: Open
Type: Bug
Package: PHP_CodeSniffer
Operating System: CentOS
Package Version: 1.5.4
PHP Version: Irrelevant
-Assigned To:
+Assigned To: squiz
Roadmap Versions:
New Comment:
-Summary: Syntax error in XML report file
+Summary: Report appended to existing file if no errors
found in run
-Assigned To:
+Assigned To: squiz
Previous Comments:
------------------------------------------------------------------------
[2014-08-29 10:00:36] ferdyp
Description:
------------
When using the checkstyle-format and writing to a report-file, each run
no
errors are found a new report is nested inside the existing report,
resulting in
invalid XML.
I ran into this problem while using Jenkins, which fails to parse the
XML
report for all projects that lack codestyle-errors.
Test script:
---------------
Run this command;
phpcs --report=checkstyle --report-checkstyle=/tmp/phpcs/report
/tmp/phpcs/example.php
Where '/tmp/phpcs/example.php' is completely empty or otherwise contains
no errors for the sniffs that are used.
The first run the report file is ok. Each consecutive run duplicate
nodes are added, corrupting the XML structure.
This only occurs when not a single error or warning is found, checkstyle
formatting is used, and a previous report file already exists.
Expected result:
----------------
/tmp/phpcs/report:
<?xml version="1.0" encoding="UTF-8"?>
<checkstyle version="1.5.4">
</checkstyle>
Actual result:
--------------
/tmp/phpcs/report:
<?xml version="1.0" encoding="UTF-8"?>
<checkstyle version="1.5.4">
<?xml version="1.0" encoding="UTF-8"?>
<checkstyle version="1.5.4">
</checkstyle>
</checkstyle>
------------------------------------------------------------------------
--
Edit this bug report at https://pear.php.net/bugs/bug.php?id=20378&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.