Edit report at http://pear.php.net/bugs/bug.php?id=17805&edit=1
ID: 17805
Updated by: [email protected]
Reported By: ms-phpcs at 256bit dot org
Summary: problems with classpath/resolving of testcase classes
-Status: Feedback
+Status: Bogus
Type: Bug
Package: PHP_CodeSniffer
Operating System: Linux SLES 11
Package Version: 1.3.0a1
PHP Version: 5.2.6
Assigned To: squiz
Roadmap Versions:
New Comment:
-Status: Feedback
+Status: Bogus
Yes sorry, I forgot to remove the Sniff for the dir in my comment.
The codes you use for sniffs are generated by PHP_CodeSniffer and can be
seen in all error messages by adding the -s command lineage argument.
This is the easiest way to determine the sniffs you want to include in a
ruleset or in a command line filter with --sniffs=[...].
Previous Comments:
------------------------------------------------------------------------
[2010-08-24 14:51:34] scoopex
After reading the code i discovered that i can get a working
configuration by change the configuration:
----
<ruleset name="OurCompany">
<description>The OurCompany coding standard.</description>
<!--
Include some additional sniffs from the Generic standard
Class is available at:
..../pear/pear/php/PHP/CodeSniffer/Standards/Generic/Sniffs/PHP/DisallowShortOpenTagSniff.php
^^^^^^ ^^^^^^^^^
remove this remove this
-->
<rule ref="Generic.PHP.DisallowShortOpenTag"/>
</ruleset>
----
Removing the marked "Sniff"/"Sniffs" make the test runnable.
I suppose that .../pear/pear/php/PHP/CodeSniffer.php" needs much better
debugging output :-)
------------------------------------------------------------------------
[2010-08-24 10:43:25] scoopex
Thanks for the fast reply :-)
My rulest looks now like this:
---------------
<ruleset name="OurCompany">
<description>The Dmc coding standard.</description>
<!--
Include some additional sniffs from the Generic standard
-->
<rule ref="Generic.Sniffs.PHP.DisallowShortOpenTag"/>
</ruleset>
---------------
(I want to reference the following file:
php/pear/pear/download/PHP_CodeSniffer-1.3.0a1/CodeSniffer/Standards/Generic/Sniffs/PHP/DisallowShortOpenTagSniff.php)
Some additional information:
- Executing phpcs with coding standard "PEAR" works without any errors.
- Executing phpcs with coding standard "OurCompany" still produces the
same error
- we run phpcs manually on command-line
(we have the target to run it with hudson)
------------------------------------------------------------------------
[2010-08-24 10:27:22] squiz
-Status: Assigned
+Status: Feedback
------------------------------------------------------------------------
[2010-08-24 10:26:57] squiz
Actually, I just noticed you have "Sniff" on the end of your included
sniff when you are supposed to leave it off. So replace the include with
this:
<rule ref="Generic.Sniffs.PHP.DisallowShortOpenTag"/>
And please try again.
------------------------------------------------------------------------
[2010-08-24 10:25:10] squiz
-Assigned To:
+Assigned To: squiz
I haven't looked into this yet, but just a note that you should set the
name attribute of the ruleset tag to be the name of your standard, not
leave it as PEAR. And you are also not including any other sniffs expect
this one Generic sniff, which you may or may not want.
Also, does this work with any other standard, like the built in PEAR or
Squiz standards (use --standard=PEAR to test)?
And does it work outside of Hudson when you run it manually?
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://pear.php.net/bugs/bug.php?id=17805