Re: PHPCS: too much noise?
| From: | Alexey Borzov | Date: | Tue, 11 Nov 2008 10:26:35 +0000 |
| Subject: | Re: PHPCS: too much noise? | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-51043@lists.php.net to get a copy of this message | ||
Hi,
Jonathan Street wrote:
I'm currently going through the process of putting together a couple of packages myself. These will be the first packages I've been the sole lead on. I can imagine the frustration with putting together a complete package and then going back to run phpcs. I was relatively lucky in that I ran phpcs fairly early and then matched what I was doing to match. Making the initial check and going back to make corrections was not fun though.Let me put it that way: I'd rather finish programming HTTP_Request2 (which is long overdue and is requested by lots of people) than waste time on fixing such kinds of "errors". Maybe someday, when it hits 2.1.1 and I'm *very* bored...
On the question of whether this level of detail is useful I don't always look at the autogenerated docs and instead just read the phpdoc comments in the file. In this situation having the tag, variable type, variable name and comment vertically aligned makes it far easier to read.Well, I agree with you here and if you look at the actual source I'm talking about, the comments *are* vertically aligned! PHPCS is just bitching about the amount of spaces I'm using to align them!
2008/11/11 Firman Wandayandi <firmanw@gmail.com>On Tue, Nov 11, 2008 at 3:17 PM, Alexey Borzov <borz_off@cs.msu.su> wrote:I just managed to receive a first "bug" for HTTP_Request2 package, http://pear.php.net/bugs/bug.php?id=14990 dealing with supposed "Coding standards violations": http://pear.cweiske.de/codingstandards/HTTP_Request2.html I dutifully looked through the results and couldn't help noticing that 95% of stuff there is petty complaints dealing with PHPDoc comments:Same here, I've just released my package yesterday and today I got "bug" http://pear.php.net/bugs/bug.php?id=14989 I have no idea since when this CS rules applied and yes almost of them are about inline doc comments.I'm quoting from the "errors" of HTTP_Request2 class:Same question for me either. Who care about indentation and how many spaces number in inline doc comments as long as it properly generated as API doc by phpDocumentor.error 36 @category tag comment indented incorrectly. Expected 1spaces but found 3.error 37 @package tag comment indented incorrectly. Expected 2 spacesbut found 4. --- last time I checked, we DON'T have any coding standards that are dealing with indenting the stuff within docblocks.error 65 Line indented incorrectly; expected at least 4 spaces, found3error 78 Line indented incorrectly; expected at least 4 spaces, found3error 80 Line indented incorrectly; expected at least 4 spaces, found3 --- this deals with the first line of doc comment blocks having an indent of 3 spaces, to align the asterisks with actual thing being documented: /** * Request URL * @var Net_URL2 */ protected $url;error 173 Expected 1 space before variable type error 173 Doc comment var "Request" does not match actual variablename "$url" at position 1error 173 Expected 1 space after the longest type--- this once again deals with indenting the stuff within PHPDoc comments (remember, we DON'T have any standards for this) and with the fact that phpDocumentor is perfectly capable of parsing the line* @param string|Net_Url2 Request URLand building proper docs without me repeating the parameter name:* @param string|Net_Url2 $url Request URLAnd this BS goes on and on and on... Now a question: how is one supposed to find actual coding standards violations in this steaming pile? Another question: if doc comments are mostly intended for phpDocumentor, which is perfectly capable of building proper docs without caring about such "errors", what's the point?