phpgroupware-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [phpGroupWare-developers] line lengths


From: Sigurd Nes
Subject: RE: [phpGroupWare-developers] line lengths
Date: Wed, 30 Apr 2008 10:43:39 +0200 (MEST)


> From: Dave Hall address@hidden
> Sent: 2008-04-30 08:28:38 CEST
> To: address@hidden
> Subject: Re: [phpGroupWare-developers] line lengths

> 
> On Tue, 2008-04-29 at 23:20 +0200, Sigurd Nes wrote:
> > Dave Hall wrote:
> > > Hi all,
> > > 
> > > I have been playing with PHP CodeSniffer recently ( see
> > > http://pear.php.net/package/PHP_CodeSniffer/ ).  It is a nice tool for
> > > checking compliance with coding standards.
> > > 
> > > Today we have been discussing using it as part of the ReSight project.
> > > This led me to take a quick look over the phpGW coding standard ( see
> > > http://svn.savannah.gnu.org/svn/phpgroupware/trunk/phpgwapi/doc/coding_standard.txt
> > >  ). I noticed that we haven't define target and maximum line lengths.  I 
> > > know this can turn into a religious debate, but I am hoping it doesn't :)
> > > 
> > > I think we have 3 options:
> > > 
> > > * Agree to not have a standard
> > > 
> > > * Make it maximum 80 characters - cos a console is only characters wide,
> > > but this ignores the fact that one shouldn't be hacking on code on a
> > > console a production box :)
> > > 
> > > * Make it something reasonable for today's technology and match our
> > > existing development approach.  I favour this option, with 100 as the
> > > target and 120 as the maximum.  My laptop is 1920x1200 so I can handle a
> > > lot more, but it starts to get hard to read at that point.
> > > 
> > > Please throw your 2 characters in :)
> > > 
> > > ?In the coming week or 2, Sigurd will be working on implementing the
> > > standard for phpGW in PHP CodeSniffer.  Once it is done, we will be
> > > putting it back into the tree (probably under
> > > phpgwapi/test/code_sniffer).  Then anyone can run the test over their
> > > code - preferably before checking their code in :) (hint hint)
> > > 
> > 
> > I would prefer to not have a standard for line lengths - as I believe it 
> > would
> > lead to a need for massive reformatting.
> 
> Huh?  How does that follow?  You make code compliant as you go, all
> new/fixed code should be compliant.  No one is proposing making all the
> code comply with the coding standard tomorrow - but if you want to, feel
> free :)
> 

I think this is a sidestep and will remove focus from what we are really 
working on.

Checking for line lengths where warnings are thrown if they are over 80
characters in length and errors if they are over 100 gives:

for property/inc : 
A TOTAL OF 2968 ERROR(S) AND 2201 WARNING(S) WERE FOUND IN 118 FILE(S)

for phpgwapi/inc:
A TOTAL OF 1646 ERROR(S) AND 2494 WARNING(S) WERE FOUND IN 148 FILE(S)

for addressbook/inc:
A TOTAL OF 269 ERROR(S) AND 375 WARNING(S) WERE FOUND IN 33 FILE(S)

for calendar/inc:
A TOTAL OF 600 ERROR(S) AND 520 WARNING(S) WERE FOUND IN 34 FILE(S)

and so on...

Regards

Sigurd

reply via email to

[Prev in Thread] Current Thread [Next in Thread]