Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 3.7.2

Bug #20206 Checkstyle opening tag missing
Submitted: 2014-02-22 04:02 UTC
From: wshafer Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.5.2)
PHP Version: 5.5.3 OS: Ubuntu
Roadmaps: (Not assigned)    
Subscription  


 [2014-02-22 04:02 UTC] wshafer (Westin Shafer)
Description: ------------ When using phpcs to output the report in checkstyle and using the "report-file" argument, the file generated is missing the opening <xml> and <checkstyle> tags. If you leave off the --report-file it displays to the terminal fine. Expected result: ---------------- <?xml version="1.0" encoding="UTF-8"?> <checkstyle version="1.5.2"> <file name="somefile"> <error line="2" column="1" severity="error" message="You must use "/**&quo t; style comments for a file comment" source="PEAR.Commenting.FileComment.WrongS tyle"/> ... Actual result: -------------- <file name="somefile"> <error line="2" column="1" severity="error" message="You must use "/**&quo t; style comments for a file comment" source="PEAR.Commenting.FileComment.WrongS tyle"/> ...

Comments

 [2014-02-24 04:39 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Feedback -Assigned To: +Assigned To: squiz
I'm not able to replicate this problem. I'm using the command: phpcs /path/to/code --report=checkstyle --report-file=checkstyle.xml Do you have any more information about how to replicate this? The fact that the screen output is correct but the file output is not is very strange. The only difference is a file_put_contents() instead of an echo. Are you running the command directly or via a build system? Is it possible that something is modifying the file after it is written? Does it happen on every single run of PHPCS?
 [2014-02-25 09:59 UTC] wshafer (Westin Shafer)
-Status: Feedback +Status: Closed
That seems possible. When I ran phpcs just now it worked fine. I'll keep tackling it from this end. Thanks, Westin
 [2014-02-25 10:00 UTC] squiz (Greg Sherwood)
Thanks for letting me know.