Re: Surprising WARNING with PHP_CodeSniffer 1.0.0RC1

From: Date: Sun, 04 Nov 2007 08:48:07 +0000
Subject: Re: Surprising WARNING with PHP_CodeSniffer 1.0.0RC1
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-48408@lists.php.net to get a copy of this message
Hi Greg, Thanks to you and Carsten to gave me an answer. My surprise was on alignment of equals signs not on line identing. BTW, is there a way to define level of warning we don't take care : Actually (hope I'm not wrong), all warnings are remove at once with phpcs -n Perharps a solution with a phpcs --config-set=XXXXX ? Oh and last, I just want to let you know there is a typo error on phpcs --help (screen) <generator> The name of a doc genertor to use ---------------------------------------^ Laurent Greg Sherwood a écrit :
Hi Laurent, Carsten's done a good job of showing the fixes, but I thought I'd show you where those warnings come from in the PEAR coding standard. First a note that they are both warnings and not errors, so they are just recommendations in the PEAR standard. The line length one comes from: http://pear.php.net/manual/en/standards.php#standards.indenting "It is recommended to keep lines at approximately 75-85 characters long for better code readability." We used 85 characters as the maximum in the sniff. As far as I can tell, there are no current standards that tell you how you should break up a line, but I think at least one of those is now proposed. The alignment of equals signs comes from: http://pear.php.net/manual/en/standards.funcalls.php "In the case of a block of related assignments, more space may be inserted to promote readability:" Again, this is a just a warning and, if I'm reading the standard correctly, can be ignored. If you want to hide warnings from the phpcs output, use the -n command line argument. Greg Laurent Laville wrote:
To Greg, Marc (package leaders) While I'm starting again to work on PHP_CompatInfo, I've run PHP_CodeSniffer 1.0.0RC1 on all files of my package distrib, and found some stranges warnings. Here are the list: look out specially on surrounding assignments Lines refered to CVS version CVS: $Id: Cli.php,v 1.22 2007/11/03 11:38:50 farell Exp $ Perharps it's still something to fix before release final version 1.0.0 of PHP_CodeSniffer , or you can give me an explain . Thanks for your package that improve a lot the QA Regards Laurent


« previous php.pear.dev (#48408) next »