Re: about PHP_CodeSniffer 1.0.0 (regression test suite and more)

From: Date: Sat, 22 Dec 2007 20:05:01 +0000
Subject: Re: about PHP_CodeSniffer 1.0.0 (regression test suite and more)
References: 1  Groups: php.pear.qa 
Request: Send a blank email to pear-qa+get-4712@lists.php.net to get a copy of this message
BTW I keep continue to investigate why I run in trouble with stable version 1.0.0 of phpcs
Greg, After investigation, I've realized that : running phpcs from my PEAR executables directory
     bin_dir          C:\wamp\php
where phpcs (and .bat for windows) should be where there is a also a subdirectory named PEAR You known its the PEAR directory
     php_dir          C:\wamp\php\pear
while CodeSniffer::process (line 221 and more) is called code between lines 235-241
    if (is_dir($standard) === true) {
        // This is a custom standard.
        $this->standardDir = $standard;
        $standard          = basename($standard);
    } else {
        $this->standardDir = realpath(dirname(__FILE__).'/CodeSniffer/Standards/'.$standard);
    }
is executed, BUT not as wanted ! HERE I suppose it's default standard (PEAR) so I didn't gave a config directive like phpcs --config-set default_standard c:\wamp\php\pear\php\codesniffer \standards\pear OR phpcs --standard=c:\wamp\php\pear\php\codesniffer\standards\pear AND code
    if (is_dir($standard) === true) {
GIVE answer YES because PEAR is a subdir of my "bin_dir" and not as it should be
        $this->standardDir = realpath(dirname(__FILE__).'/CodeSniffer/Standards/'.$standard);
pick from default phpcs standards dirs Finally a new bug for final release 1.0.0 Tell me if I'm wrong Greg ! So temporary solution is to force default dir as explained before phpcs --config-set default_standard xxxxx OR phpcs --standard=xxxx Hope it will help Laurent

« previous php.pear.qa (#4712) next »