Debian Bug report logs - #604879
RFP: phptidy -- Beautifier for PHP code

Package: wnpp; Maintainer for wnpp is wnpp@debian.org;

Reported by: jidanni@jidanni.org

Date: Thu, 25 Nov 2010 00:54:01 UTC

Severity: wishlist

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, phptidy@cmr.cx, pkg-php-maint@lists.alioth.debian.org, wnpp@debian.org:
Bug#604879; Package wnpp. (Thu, 25 Nov 2010 00:54:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to jidanni@jidanni.org:
New Bug report received and forwarded. Copy sent to phptidy@cmr.cx, pkg-php-maint@lists.alioth.debian.org, wnpp@debian.org. (Thu, 25 Nov 2010 00:54:04 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: jidanni@jidanni.org
To: submit@bugs.debian.org
Subject: RFP: phptidy -- Beautifier for PHP code
Date: Thu, 25 Nov 2010 08:50:54 +0800
X-debbugs-Cc: phptidy@cmr.cx, pkg-php-maint@lists.alioth.debian.org
Package: wnpp
Severity: wishlist

* Package name    : phptidy
  Version         : 2.10
  Upstream Author : Magnus Rosenbaum <phptidy@cmr.cx>
* URL             : http://developer.berlios.de/projects/phptidy/
* License         : GPL
  Programming Lang: PHP
  Description     : Beautifier for PHP code

This is a little tool for formatting PHP code. It aims to make the code better
readable and thus better understandable.

Unlike other beautifiers, phptidy does not completely reformat the code and
remove formatting, which was intended by the author. It only touches things
which are usually not intended. In case of doubt, phptidy will not touch
anything. Because of this strategy it is also very unlikely, that phptidy by
fault changes the functionality of the code.

phptidy is useful in many situations:

- You can use it on your own code during development to keep the code tidy,
  wasting no time on indenting and formatting by hand.

- In a project with more than one person coding you have less trouble with
  people who do not confirm to the style guide.

- If you use a version control system you can require all participating people
  to run phptidy before committing changes. Then you won't have anymore trouble
  with unintended changes due to code formatting or with the trailing
  whitespace or wrong line breaks of some brain dead editors (or their users).

- If you have to maintain some ultimately ugly code of someone else. After
  running phptidy the code will be much better readable. Well, the code will
  not be perfect, but it's a big help anyway.

The used coding standard is mainly inspired by the PEAR Coding Standards:
http://pear.php.net/manual/en/standards.php

phptidy is released under the GPL and can be used for free.

[Yes, there already is a similarly named php5-tidy package here in Debian
(but which tidies HTML.) Magnus: RFP means I Request For
somebody to Package this for Debian. --jidanni]




Information forwarded to debian-bugs-dist@lists.debian.org, wnpp@debian.org:
Bug#604879; Package wnpp. (Fri, 26 Nov 2010 09:18:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Thomas Goirand <thomas@goirand.fr>:
Extra info received and forwarded to list. Copy sent to wnpp@debian.org. (Fri, 26 Nov 2010 09:18:03 GMT) Full text and rfc822 format available.

Message #10 received at 604879@bugs.debian.org (full text, mbox):

From: Thomas Goirand <thomas@goirand.fr>
To: jidanni@jidanni.org, 604879@bugs.debian.org
Subject: Re: [php-maint] Bug#604879: RFP: phptidy -- Beautifier for PHP code
Date: Fri, 26 Nov 2010 17:09:15 +0800
Hi,

I didn't try your phptidy, it might be very good, but I just have short
remarks on what I read.

On 11/25/2010 08:50 AM, jidanni@jidanni.org wrote:
> The used coding standard is mainly inspired by the PEAR Coding Standards:
> http://pear.php.net/manual/en/standards.php

Reading this document...

"Use an indent of 4 spaces, with no tabs.This helps to avoid problems
with diffs, patches, SVN history and annotations."

Frankly, that's always the same stupid coding standard inspired from the
Linux kernel (and same with GPL v3 vs v2...). This is really retarded
thinking imposed by the kernel despots, if you ask me. I will never
understand the 4 spaces instead of TAB thing. The excuse of having a
retarded VCS is even more silly. If the VCS is bad, then change the VCS
for something that knows how to handle things! By the way, stuffs like
SVN and CVS should be banished (why not use RCS... ?).

"It is recommended to keep lines at approximately 75-85 characters long
for better code readability."

Yes, right, just in case we are editing some PHP code with a teletype or
a VAX terminals. How about going back to use 8 bits computing as well?
IMHO, it's even more silly to say "approximately 75-85". Either say
"less than 80", either say nothing.

I'm ok with stupidity. I'm not ok with imposing one's stupidity to
others and saying it should be considered god's truth.

All this being said, phptidy should be very useful for very messy
people! :) I currently have no time to do the sponsorship, maybe later
(after Squeeze is out).

Thomas




Information forwarded to debian-bugs-dist@lists.debian.org, wnpp@debian.org:
Bug#604879; Package wnpp. (Sat, 27 Nov 2010 01:57:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to jidanni@jidanni.org:
Extra info received and forwarded to list. Copy sent to wnpp@debian.org. (Sat, 27 Nov 2010 01:57:02 GMT) Full text and rfc822 format available.

Message #15 received at 604879@bugs.debian.org (full text, mbox):

From: jidanni@jidanni.org
To: thomas@goirand.fr
Cc: 604879@bugs.debian.org
Subject: Re: [php-maint] Bug#604879: RFP: phptidy -- Beautifier for PHP code
Date: Sat, 27 Nov 2010 09:56:22 +0800
Thomas, Glad you might be one day maintaining this package. Hope
upstream one day hears your comments about formatting. (I myself often
use a tiny 7 inch EEEPC, so do enjoy old fashioned rules in fact.)




Information forwarded to debian-bugs-dist@lists.debian.org, wnpp@debian.org:
Bug#604879; Package wnpp. (Wed, 01 Dec 2010 01:57:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to jidanni@jidanni.org:
Extra info received and forwarded to list. Copy sent to wnpp@debian.org. (Wed, 01 Dec 2010 01:57:05 GMT) Full text and rfc822 format available.

Message #20 received at 604879@bugs.debian.org (full text, mbox):

From: jidanni@jidanni.org
To: phptidy@cmr.cx
Cc: 604879@bugs.debian.org
Subject: Some things to fix in phptidy
Date: Sun, 28 Nov 2010 19:02:36 +0800
Some things to fix in phptidy:

define('CONFIGFILE', "./.phptidy-config.php");... should also read ~/.phptidy-config

We also find no config item to turn off using cache files.

Should add manpage.

"source   Show processed source code of affected files"
probably means 'like the suffix command, but write output to stdoun'

Which just shows that the user should be doing the ">" etc. instead of
trying to do it all for the user.

project files include/exclude: all should be the user's responsiblity,
to just list them one by one in a makefile, or on the command line etc.

Don't print the top of the config file each time we run phptidy.

The diff etc commands should not print escape sequences to the
terminal.

Try this: save the output of the source command to a second file, and
then run phptidy again on that second file. No output will be produced
at all! (of course we have first removed the stuff that should have
been sent to STDERR from the top.) Now insert a blank line at the top.
We now get output again.

You may have considered space after comma, but not space after
semi-colon.

switch {}:  all case: end up in first column.

OK. I figured out how to meet all my php formatting needs.
I did
apt-get install php-elisp
Within which (aside from
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=414430 ) doing
C-x h runs the command mark-whole-buffer, then
TAB (translated from <tab>) runs the command c-indent-line-or-region,
indents very well. (But doesn't do spaces around colons etc.)




Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Fri Apr 18 08:16:08 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.