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

Bug #16804 Report filename is shortened too much
Submitted: 2009-11-19 06:30 UTC
From: aashley Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.2.1)
PHP Version: 5.2.10-2ubuntu6.1 OS:
Roadmaps: (Not assigned)    
Subscription  


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 48 - 3 = ?

 
 [2009-11-19 06:30 UTC] aashley (Adam Ashley)
Description: ------------ Error report truncates filename to much making it impossible to determine which file the errors are from. Expected result is from 1.2.0 Test script: --------------- /usr/bin/phpcs -v --standard=Mu --ignore=dir_which_doesnt_exist,documentation,thirdparty,build/test,build/static,static,javascript . Expected result: ---------------- FILE: ...uildslave/slave/mu-framework_branch-version2.0-phpcs/build/init/web.php -------------------------------------------------------------------------------- FOUND 0 ERROR(S) AND 1 WARNING(S) AFFECTING 1 LINE(S) -------------------------------------------------------------------------------- 1 | WARNING | 30% of lines in file must be comments. Currently only 10 of | | approximately 45 (22%) lines of real code is. -------------------------------------------------------------------------------- Actual result: -------------- FILE: ...eb.php -------------------------------------------------------------------------------- FOUND 0 ERROR(S) AND 1 WARNING(S) AFFECTING 1 LINE(S) -------------------------------------------------------------------------------- 1 | WARNING | 30% of lines in file must be comments. Currently only 10 of | | approximately 45 (22%) lines of real code is. --------------------------------------------------------------------------------

Comments

 [2009-11-19 06:33 UTC] aashley (Adam Ashley)
Appending --report-width=80 resolves the problem. When --report-width is not supplied about half of the files with errors are truncated to the last 4 to 8 characters
 [2009-11-21 14:38 UTC] kguest (Ken Guest)
-Summary: Report filename is shortened to much +Summary: Report filename is shortened too much
 [2009-11-23 10:41 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Feedback -Assigned To: +Assigned To: squiz
I can't replicate this at all and the code that does it is pretty basic. Any chance you can give me some full file paths that do break and some that don't? There must be a pattern there somewhere. Otherwise, also try setting the default report width. It is already 80 and the function accepts a minimum of 70, but it is worth a try: phpcs --config-set report_width 80
 [2009-11-23 10:49 UTC] aashley (Adam Ashley)
 [2009-11-23 10:49 UTC] aashley (Adam Ashley)
 [2009-11-23 10:53 UTC] aashley (Adam Ashley)
-PHP Version: 5.2.5 +PHP Version: 5.2.10-2ubuntu6.1
I have added to files phpcs-1.2.0-files and phpcs-1.2.1-files which are the FILE: lines from the two respective versions of phpcs. Doing --config_set made no difference to the output. Increasing report with a small amount (ie 1) adds a corresponding number of characters to the output of the lines. Only by increasing the report width to larger than all the strings is the only way to get them to display
 [2009-11-23 11:01 UTC] squiz (Greg Sherwood)
I figured it out with your filenames. Just stupid code in the end. Thanks for sending that info through.
 [2009-11-23 11:03 UTC] squiz (Greg Sherwood)
-Status: Feedback +Status: Closed
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.