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

Request #12271 Don't strip all blank lines
Submitted: 2007-10-18 07:34 UTC Modified: 2010-09-08 05:28 UTC
From: rigrig Assigned: clbustos
Status: Assigned Package: PHP_Beautifier (version 0.1.13)
PHP Version: 5.2.3 OS: Linux
Roadmaps: 1.0.0RC1    
Subscription  


 [2007-10-18 07:34 UTC] rigrig (Richard De Boer)
Description: ------------ It would be nice if there was an option to leave blank lines, since they could be there to improve readability. Ideally there would be an option to * replace all white space-only lines with an empty line * specify a maximum number of blank lines in a row (I used 2 in my example) Test script: --------------- //something followed by (too) many empty lines //some more //next line actually does something echo ("Hello world!"); Expected result: ---------------- //something followed by (too) many empty lines //some more //next line actually does something echo ("Hello world!"); Actual result: -------------- //something followed by (too) many empty lines //some more //next line actually does something echo ("Hello world!");

Comments

 [2008-01-09 17:19 UTC] mrich (Matthew Rich)
Yes! I can't believe this option is not part of this package already; while correcting indentation certainly helps make a code file more readable, stripping out all the empty lines can make it worse than the original! I agree there should be a way to preserve newlines in the file and specify a maximum number of consecutive newlines (IE empty lines).
 [2008-09-12 14:40 UTC] sunsetbrew (Thomas Davis)
I agree. The removal of all blank lines is very difficult to read.
 [2009-04-21 21:35 UTC] mvanlamz (Mike van Lammeren)
I agree that newlines should not be stripped. This is a total deal-breaker for me. Code without blank lines is not more beautiful.
 [2009-10-16 23:46 UTC] harty83 (Alan Hartless)
YES!! My project director just decided to use this against all our code and stripping out all the blank lines has me all in a tizzy. I agree with the above statement that code all squashed together is not beautiful! Thanks, Alan
 [2010-03-16 07:12 UTC] clbustos (Claudio Bustos)
-Assigned To: +Assigned To: clbustos
First priority, boys!
 [2010-04-16 13:35 UTC] mkpear (Marijn Koesen)
Nice, we'd like to see this fixed as well. This is a showstopper for us as we use whitespaces to clearify the code. Thanks
 [2010-09-03 07:48 UTC] cf357 (Adrien Mogenet)
What about this bug ? Any updates ? Still "assigned"...
 [2010-09-08 05:28 UTC] jespino (Jesús Espino)
Claudio bustos is working on it, but you can find a temporal solution in http://github.com/jespino/PHP_Beautifier/tree/whitespaces Anyway, Claudio is working in a better solution.
 [2010-11-16 20:42 UTC] dmcritchie (Dennis McRitchie)
Unfortunately, jespino, I can't get your version to work. The tar.gz version seems to remove all blank lines and then insert a blank line after every comment line. The latest version in your git repo seems to simply remove all blank lines, just like the standard version. Am I missing some trick on how to run this.
 [2012-05-02 10:29 UTC] konafets (Stefano Kowalke)
How is the status with this issue? Will there any progress? Is the project dead?