FAQ
Edit report at https://pear.php.net/bugs/bug.php?id=20145&edit=1

  ID: 20145
  Updated by: [email protected]
  Reported By: alan dot campbell at riskpoint dot co dot uk
  Summary: Custom ruleset does not register PEAR sniffs
-Status: Open
+Status: Feedback
  Type: Bug
  Package: PHP_CodeSniffer
  Operating System: OS X (10.9)
  Package Version: 1.5.0
  PHP Version: 5.4.17
-Assigned To:
+Assigned To: squiz
  Roadmap Versions:
  New Comment:

-Status: Open
+Status: Feedback
-Assigned To:
+Assigned To: squiz
This is working fine for me, on OS X (10.9) with the PHP 5.4.17 that
ships with it. I
get:

$ phpcs -v --standard=pear_ruleset.xml phpcs_rules_test.php
Registering sniffs in the MyPEARStandardTest standard... DONE (26 sniffs

registered)
Creating file list... DONE (1 files in queue)
Changing into directory /.../PHP_CodeSniffer
Processing phpcs_rules_test.php [10 tokens in 5 lines]... DONE in < 1
second (2
errors, 0 warnings)

FILE: /.../phpcs_rules_test.php
--------------------------------------------------------------------------------
FOUND 2 ERROR(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
  2 | ERROR | Missing file doc comment
  2 | ERROR | Missing class doc comment
--------------------------------------------------------------------------------

Time: 20 ms, Memory: 2.50Mb

I'm not really sure what to suggest as it looks like we're using the
exact same
environment and sample code.

You could try doing a git clone of the repo and running it directly from
there instead
of via PEAR:

git clone git://github.com/squizlabs/PHP_CodeSniffer.git
cd PHP_CodeSniffer
php scripts/phpcs -v --standard=pear_ruleset.xml phpcs_rules_test.php


Previous Comments:
------------------------------------------------------------------------

[2013-12-10 16:40:47] alancampbell

pear_ruleset.xml

<?xml version="1.0"?>
<ruleset name="MyPEARStandardTest">
   <description>Test PEAR coding standard.</description>
   <rule ref="PEAR"/>
</ruleset>

phpcs_rules_test.php

<?php
class PHPCS_Rules_Test
{

}

------------------------------------------------------------------------

[2013-12-10 16:38:05] alancampbell

-Operating System:
+Operating System: OS X (10.9)


------------------------------------------------------------------------

[2013-12-10 16:35:33] alancampbell

Description:
------------
Creating a very basic custom rules file loading only PEAR standard does
not register any sniff when run with the following command:

phpcs -v --standard=pear_ruleset.xml phpcs_rules_test.php

Should give the same result as running the following:

phpcs -v --standard=PEAR phpcs_rules_test.php

Repeating the above test, replacing PEAR with all other standards works
as expected and gives the same results.

Expected result:
----------------
Registering sniffs in the PEAR standard... DONE (26 sniffs registered)
Creating file list... DONE (1 files in queue)

Actual result:
--------------
Registering sniffs in the MyPEARStandardTest standard... DONE (0 sniffs
registered)
Creating file list... DONE (1 files in queue)

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedDec 11, '13 at 9:57p
activeDec 11, '13 at 9:57p
posts1
users1
websitepear.php.net

1 user in discussion

Gsherwood: 1 post

People

Translate

site design / logo © 2023 Grokbase