Re: phpcs throwing warnings on trivial things

From: Date: Sat, 05 Apr 2008 22:23:44 +0000
Subject: Re: phpcs throwing warnings on trivial things
References: 1 2 3 4  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-49647@lists.php.net to get a copy of this message
Joe Stump wrote:
I've also found the following that I consider outright bugs: 1.) It constantly throws a WARNING for my @link lines that are over 85 characters. It should, IMO, say "Oh, this is an @link tag and URI's can be > 85 characters so, if it's a valid URI (Validate::uri()) then I'm going to ignore this". I made a change previously to fix this for licence tags and cvs/svn ID tags, so I'll make the same change for link tags too. Thanks for pointing it out.
2.) It wants me to constantly align ='s. I'm all for that normally, but it's been asking me to put 19 spaces in to align them, which I think makes the code even more unreadable (I could be wholly alone on this): $n = 1; $this->longArrayNameHere[$this->myKeyName] = 2; I think it should ignore the = alignment if it's over, say, 5 characters or something. Or, maybe, we make a rule that CS warnings cannot ever hold a package back from being accepted. Christian Weiske got annoyed by this a while ago and submitted a feature request (http://pear.php.net/bugs/bug.php?id=11555). This sniff has a threshold so that is the required amount of padding exceeds a specific value, the line is ignored. By default, this is 1000 characters, but it could easily be set to something like 5 so that any alignment that requires more than 5 spaces is ignored.
But, I do need the written standard updated before making the change, just to make it official and to tell the next person why the value 5 is hard-coded in phpcs. Greg

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