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

ID: 19498
Updated by: thinice@gmail.com
Reported By: thinice@gmail.com
Summary: CodeSniffer.php and DIRECTORY_SEPARATOR causing
issues
Status: Open
Type: Bug
Package: PHP_CodeSniffer
Operating System: Windows
Package Version: 1.3.4
PHP Version: 5.3.14
Roadmap Versions:
New Comment:

That's @834, not @835 with the $path assignment. **


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

[2012-07-09 21:20:40] thinice

Description:
------------
On Line 835 on CodeSniffer.php, the recent diff changed the line from:

$path = realpath(dirname(__FILE__).'/CodeSniffer/Standards/'.$path);

to:

$path =
realpath(dirname(__FILE__).'/CodeSniffer/Standards').DIRECTORY_SEPARATOR.$path;

It should read something like this:

$path =
realpath(dirname(__FILE__).DIRECTORY_SEPARATOR.'CodeSniffer'.DIRECTORY_SEPARATOR.'Standards'.DIRECTORY_SEPARATOR.$path);

There are several other lines in this file that are similar that may
need to be looked into as well - but I just had a bear of a time
tracking this issue down.

You end up with a return value of this, i.e:
"D:\CODE\DevTools\pear\PHP\CodeSniffer\Standards\PEAR/Sniffs/Functions/ValidDefaultValueSniff.php"

The problem is (at least in Windows), when the array from the
getSniffs() call is used in setTokenListeners() (Approx Line 659) - the
$sniffPos var is coming up with dud results because of the mixed
separators in the path.


Test script:
---------------
I added echo "Garbaging: ".$file."
";

To the conditional starting at Line 659 of CodeSniffer.php to verify
that a lot of sniffs are being discarded because of the mixed directory
separators in the sniff processing.

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

Search Discussions

  • Thinice at Jul 9, 2012 at 7:20 pm
    Edit report at https://pear.php.net/bugs/bug.php?id=19498&edit=1

    ID: 19498
    Updated by: thinice@gmail.com
    Reported By: thinice@gmail.com
    Summary: CodeSniffer.php and DIRECTORY_SEPARATOR causing
    issues
    -Status: Open
    +Status: Critical
    Type: Bug
    Package: PHP_CodeSniffer
    Operating System: Windows
    Package Version: 1.3.4
    PHP Version: 5.3.14
    Roadmap Versions:
    New Comment:

    -Status: Open
    +Status: Critical



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

    [2012-07-09 21:22:45] thinice

    That's @834, not @835 with the $path assignment. **

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

    [2012-07-09 21:20:40] thinice

    Description:
    ------------
    On Line 835 on CodeSniffer.php, the recent diff changed the line from:

    $path = realpath(dirname(__FILE__).'/CodeSniffer/Standards/'.$path);

    to:

    $path =
    realpath(dirname(__FILE__).'/CodeSniffer/Standards').DIRECTORY_SEPARATOR.$path;

    It should read something like this:

    $path =
    realpath(dirname(__FILE__).DIRECTORY_SEPARATOR.'CodeSniffer'.DIRECTORY_SEPARATOR.'Standards'.DIRECTORY_SEPARATOR.$path);

    There are several other lines in this file that are similar that may
    need to be looked into as well - but I just had a bear of a time
    tracking this issue down.

    You end up with a return value of this, i.e:
    "D:\CODE\DevTools\pear\PHP\CodeSniffer\Standards\PEAR/Sniffs/Functions/ValidDefaultValueSniff.php"

    The problem is (at least in Windows), when the array from the
    getSniffs() call is used in setTokenListeners() (Approx Line 659) - the
    $sniffPos var is coming up with dud results because of the mixed
    separators in the path.


    Test script:
    ---------------
    I added echo "Garbaging: ".$file."
    ";

    To the conditional starting at Line 659 of CodeSniffer.php to verify
    that a lot of sniffs are being discarded because of the mixed directory
    separators in the sniff processing.

    ------------------------------------------------------------------------
  • Thinice at Jul 9, 2012 at 7:20 pm
    Edit report at https://pear.php.net/bugs/bug.php?id=19498&edit=1

    ID: 19498
    Updated by: thinice@gmail.com
    Reported By: thinice@gmail.com
    -Summary: CodeSniffer.php and DIRECTORY_SEPARATOR causing
    issues
    +Summary: CodeSniffer.php and DIRECTORY_SEPARATOR change
    causing sniffs to be disregarded
    Status: Critical
    Type: Bug
    Package: PHP_CodeSniffer
    Operating System: Windows
    Package Version: 1.3.4
    PHP Version: 5.3.14
    Roadmap Versions:
    New Comment:

    -Summary: CodeSniffer.php and DIRECTORY_SEPARATOR causing
    issues
    +Summary: CodeSniffer.php and DIRECTORY_SEPARATOR change
    causing sniffs to be disregarded



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

    [2012-07-09 21:26:06] thinice

    -Status: Open
    +Status: Critical


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

    [2012-07-09 21:22:45] thinice

    That's @834, not @835 with the $path assignment. **

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

    [2012-07-09 21:20:40] thinice

    Description:
    ------------
    On Line 835 on CodeSniffer.php, the recent diff changed the line from:

    $path = realpath(dirname(__FILE__).'/CodeSniffer/Standards/'.$path);

    to:

    $path =
    realpath(dirname(__FILE__).'/CodeSniffer/Standards').DIRECTORY_SEPARATOR.$path;

    It should read something like this:

    $path =
    realpath(dirname(__FILE__).DIRECTORY_SEPARATOR.'CodeSniffer'.DIRECTORY_SEPARATOR.'Standards'.DIRECTORY_SEPARATOR.$path);

    There are several other lines in this file that are similar that may
    need to be looked into as well - but I just had a bear of a time
    tracking this issue down.

    You end up with a return value of this, i.e:
    "D:\CODE\DevTools\pear\PHP\CodeSniffer\Standards\PEAR/Sniffs/Functions/ValidDefaultValueSniff.php"

    The problem is (at least in Windows), when the array from the
    getSniffs() call is used in setTokenListeners() (Approx Line 659) - the
    $sniffPos var is coming up with dud results because of the mixed
    separators in the path.


    Test script:
    ---------------
    I added echo "Garbaging: ".$file."
    ";

    To the conditional starting at Line 659 of CodeSniffer.php to verify
    that a lot of sniffs are being discarded because of the mixed directory
    separators in the sniff processing.

    ------------------------------------------------------------------------
  • Gsherwood at Jul 9, 2012 at 10:15 pm
    Edit report at https://pear.php.net/bugs/bug.php?id=19498&edit=1

    ID: 19498
    Updated by: gsherwood@squiz.net
    Reported By: thinice@gmail.com
    Summary: CodeSniffer.php and DIRECTORY_SEPARATOR change
    causing sniffs to be disregarded
    -Status: Critical
    +Status: Open
    Type: Bug
    Package: PHP_CodeSniffer
    Operating System: Windows
    Package Version: 1.3.4
    PHP Version: 5.3.14
    -Assigned To:
    +Assigned To: squiz
    Roadmap Versions:
    New Comment:

    -Status: Critical
    +Status: Open
    -Assigned To:
    +Assigned To: squiz
    Please don't set the severity of bug reports. I look at all of them no
    matter what they
    are.


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

    [2012-07-09 21:26:52] thinice

    -Summary: CodeSniffer.php and DIRECTORY_SEPARATOR causing
    issues
    +Summary: CodeSniffer.php and DIRECTORY_SEPARATOR change
    causing sniffs to be disregarded


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

    [2012-07-09 21:26:06] thinice

    -Status: Open
    +Status: Critical


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

    [2012-07-09 21:22:45] thinice

    That's @834, not @835 with the $path assignment. **

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

    [2012-07-09 21:20:40] thinice

    Description:
    ------------
    On Line 835 on CodeSniffer.php, the recent diff changed the line from:

    $path = realpath(dirname(__FILE__).'/CodeSniffer/Standards/'.$path);

    to:

    $path =
    realpath(dirname(__FILE__).'/CodeSniffer/Standards').DIRECTORY_SEPARATOR.$path;

    It should read something like this:

    $path =
    realpath(dirname(__FILE__).DIRECTORY_SEPARATOR.'CodeSniffer'.DIRECTORY_SEPARATOR.'Standards'.DIRECTORY_SEPARATOR.$path);

    There are several other lines in this file that are similar that may
    need to be looked into as well - but I just had a bear of a time
    tracking this issue down.

    You end up with a return value of this, i.e:
    "D:\CODE\DevTools\pear\PHP\CodeSniffer\Standards\PEAR/Sniffs/Functions/ValidDefaultValueSniff.php"

    The problem is (at least in Windows), when the array from the
    getSniffs() call is used in setTokenListeners() (Approx Line 659) - the
    $sniffPos var is coming up with dud results because of the mixed
    separators in the path.


    Test script:
    ---------------
    I added echo "Garbaging: ".$file."
    ";

    To the conditional starting at Line 659 of CodeSniffer.php to verify
    that a lot of sniffs are being discarded because of the mixed directory
    separators in the sniff processing.

    ------------------------------------------------------------------------
  • Gsherwood at Jul 10, 2012 at 12:21 am
    Edit report at https://pear.php.net/bugs/bug.php?id=19498&edit=1

    ID: 19498
    Updated by: gsherwood@squiz.net
    Reported By: thinice@gmail.com
    Summary: CodeSniffer.php and DIRECTORY_SEPARATOR change
    causing sniffs to be disregarded
    -Status: Assigned
    +Status: Feedback
    Type: Bug
    Package: PHP_CodeSniffer
    Operating System: Windows
    Package Version: 1.3.4
    PHP Version: 5.3.14
    Assigned To: squiz
    Roadmap Versions:
    New Comment:

    -Status: Assigned
    +Status: Feedback
    I've run the latest git clone version of PHP_CodeSniffer on both Windows
    and OS X
    and get exactly the same results when testing the PEAR, Squiz, Zend and
    Generic
    coding standards over the CodeSniffer.php file.

    To check, I used the -v command line argument so it tells me exactly how
    many
    sniffs were found and registered. The number of sniffs was the same each
    time and
    the number of errors, warnings and notices was also the same.

    Are you using the git clone or a PEAR package? If you have patched your
    own install,
    did you just patch this one change or did you patch all fixes (this
    issue was fixed with
    other previous changes that appear unrelated)? What standard are you
    testing with
    and how many sniffs are registered on Windows vs whatever other OS you
    are
    comparing the results on?

    Sorry for the bunch of questions, but I can't fix this unless I can
    replicate it.


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

    [2012-07-10 00:21:21] squiz

    -Status: Critical
    +Status: Open
    -Assigned To:
    +Assigned To: squiz
    Please don't set the severity of bug reports. I look at all of them no
    matter what they
    are.

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

    [2012-07-09 21:26:52] thinice

    -Summary: CodeSniffer.php and DIRECTORY_SEPARATOR causing
    issues
    +Summary: CodeSniffer.php and DIRECTORY_SEPARATOR change
    causing sniffs to be disregarded


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

    [2012-07-09 21:26:06] thinice

    -Status: Open
    +Status: Critical


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

    [2012-07-09 21:22:45] thinice

    That's @834, not @835 with the $path assignment. **

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

    [2012-07-09 21:20:40] thinice

    Description:
    ------------
    On Line 835 on CodeSniffer.php, the recent diff changed the line from:

    $path = realpath(dirname(__FILE__).'/CodeSniffer/Standards/'.$path);

    to:

    $path =
    realpath(dirname(__FILE__).'/CodeSniffer/Standards').DIRECTORY_SEPARATOR.$path;

    It should read something like this:

    $path =
    realpath(dirname(__FILE__).DIRECTORY_SEPARATOR.'CodeSniffer'.DIRECTORY_SEPARATOR.'Standards'.DIRECTORY_SEPARATOR.$path);

    There are several other lines in this file that are similar that may
    need to be looked into as well - but I just had a bear of a time
    tracking this issue down.

    You end up with a return value of this, i.e:
    "D:\CODE\DevTools\pear\PHP\CodeSniffer\Standards\PEAR/Sniffs/Functions/ValidDefaultValueSniff.php"

    The problem is (at least in Windows), when the array from the
    getSniffs() call is used in setTokenListeners() (Approx Line 659) - the
    $sniffPos var is coming up with dud results because of the mixed
    separators in the path.


    Test script:
    ---------------
    I added echo "Garbaging: ".$file."
    ";

    To the conditional starting at Line 659 of CodeSniffer.php to verify
    that a lot of sniffs are being discarded because of the mixed directory
    separators in the sniff processing.

    ------------------------------------------------------------------------
  • Thinice at Jul 10, 2012 at 3:17 am
    Edit report at https://pear.php.net/bugs/bug.php?id=19498&edit=1

    ID: 19498
    Updated by: thinice@gmail.com
    Reported By: thinice@gmail.com
    Summary: CodeSniffer.php and DIRECTORY_SEPARATOR change
    causing sniffs to be disregarded
    Status: Feedback
    Type: Bug
    Package: PHP_CodeSniffer
    Operating System: Windows
    Package Version: 1.3.4
    PHP Version: 5.3.14
    Assigned To: squiz
    Roadmap Versions:
    New Comment:

    - This is with the PEAR package.
    - I patched the one line @834 to fix the issue using the line in my
    report
    - The standard I'm using is home brew and installed in the Standards
    directory alongside Squiz, Generic, PEAR, etc.
    - The standard is the only extra standard not distributed with PEAR
    - The standard has a few custom sniffs, with the majority being
    referenced by the ruleset.xml, most come from Squiz.
    - The Sniffs also all report back for me (which is why it was a bear to
    find)
    - Come run time, the only Sniffs that run are the ones that are custom
    (inferred via directory structure, not from the ruleset.xml)


    I will try to put together a test case and package it up for sample.


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

    [2012-07-10 02:27:07] squiz

    -Status: Assigned
    +Status: Feedback
    I've run the latest git clone version of PHP_CodeSniffer on both Windows
    and OS X
    and get exactly the same results when testing the PEAR, Squiz, Zend and
    Generic
    coding standards over the CodeSniffer.php file.

    To check, I used the -v command line argument so it tells me exactly how
    many
    sniffs were found and registered. The number of sniffs was the same each
    time and
    the number of errors, warnings and notices was also the same.

    Are you using the git clone or a PEAR package? If you have patched your
    own install,
    did you just patch this one change or did you patch all fixes (this
    issue was fixed with
    other previous changes that appear unrelated)? What standard are you
    testing with
    and how many sniffs are registered on Windows vs whatever other OS you
    are
    comparing the results on?

    Sorry for the bunch of questions, but I can't fix this unless I can
    replicate it.

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

    [2012-07-10 00:21:21] squiz

    -Status: Critical
    +Status: Open
    -Assigned To:
    +Assigned To: squiz
    Please don't set the severity of bug reports. I look at all of them no
    matter what they
    are.

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

    [2012-07-09 21:26:52] thinice

    -Summary: CodeSniffer.php and DIRECTORY_SEPARATOR causing
    issues
    +Summary: CodeSniffer.php and DIRECTORY_SEPARATOR change
    causing sniffs to be disregarded


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

    [2012-07-09 21:26:06] thinice

    -Status: Open
    +Status: Critical


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

    [2012-07-09 21:22:45] thinice

    That's @834, not @835 with the $path assignment. **

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

    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=19498
  • Gsherwood at Jul 10, 2012 at 3:42 am
    Edit report at https://pear.php.net/bugs/bug.php?id=19498&edit=1

    ID: 19498
    Updated by: gsherwood@squiz.net
    Reported By: thinice@gmail.com
    Summary: CodeSniffer.php and DIRECTORY_SEPARATOR change
    causing sniffs to be disregarded
    Status: Feedback
    Type: Bug
    Package: PHP_CodeSniffer
    Operating System: Windows
    Package Version: 1.3.4
    PHP Version: 5.3.14
    Assigned To: squiz
    Roadmap Versions:
    New Comment:

    The patch you applied is likely the problem. Even though that one line
    needed to be
    correct to fix that bug, previous fixes made since the release also
    contributed to the
    fix. Please test with the latest git clone to ensure you have all
    Windows fixes.

    If you want to install from a git clone:
    git clone git://github.com/squizlabs/PHP_CodeSniffer.git
    cd PHP_CodeSniffer
    pear uninstall php_codesniffer
    pear install package.xml

    Or, just run PHPCS directly from the clone, so it doesn't touch your
    installed version;
    git clone git://github.com/squizlabs/PHP_CodeSniffer.git
    cd PHP_CodeSniffer
    php scripts/phpcs ...


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

    [2012-07-10 05:23:57] thinice

    - This is with the PEAR package.
    - I patched the one line @834 to fix the issue using the line in my
    report
    - The standard I'm using is home brew and installed in the Standards
    directory alongside Squiz, Generic, PEAR, etc.
    - The standard is the only extra standard not distributed with PEAR
    - The standard has a few custom sniffs, with the majority being
    referenced by the ruleset.xml, most come from Squiz.
    - The Sniffs also all report back for me (which is why it was a bear to
    find)
    - Come run time, the only Sniffs that run are the ones that are custom
    (inferred via directory structure, not from the ruleset.xml)


    I will try to put together a test case and package it up for sample.

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

    [2012-07-10 02:27:07] squiz

    -Status: Assigned
    +Status: Feedback
    I've run the latest git clone version of PHP_CodeSniffer on both Windows
    and OS X
    and get exactly the same results when testing the PEAR, Squiz, Zend and
    Generic
    coding standards over the CodeSniffer.php file.

    To check, I used the -v command line argument so it tells me exactly how
    many
    sniffs were found and registered. The number of sniffs was the same each
    time and
    the number of errors, warnings and notices was also the same.

    Are you using the git clone or a PEAR package? If you have patched your
    own install,
    did you just patch this one change or did you patch all fixes (this
    issue was fixed with
    other previous changes that appear unrelated)? What standard are you
    testing with
    and how many sniffs are registered on Windows vs whatever other OS you
    are
    comparing the results on?

    Sorry for the bunch of questions, but I can't fix this unless I can
    replicate it.

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

    [2012-07-10 00:21:21] squiz

    -Status: Critical
    +Status: Open
    -Assigned To:
    +Assigned To: squiz
    Please don't set the severity of bug reports. I look at all of them no
    matter what they
    are.

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

    [2012-07-09 21:26:52] thinice

    -Summary: CodeSniffer.php and DIRECTORY_SEPARATOR causing
    issues
    +Summary: CodeSniffer.php and DIRECTORY_SEPARATOR change
    causing sniffs to be disregarded


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

    [2012-07-09 21:26:06] thinice

    -Status: Open
    +Status: Critical


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

    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=19498
  • Thinice at Jul 10, 2012 at 3:52 am
    Edit report at https://pear.php.net/bugs/bug.php?id=19498&edit=1

    ID: 19498
    Comment by: thinice@gmail.com
    Reported By: thinice@gmail.com
    Summary: CodeSniffer.php and DIRECTORY_SEPARATOR change
    causing sniffs to be disregarded
    Status: Feedback
    Type: Bug
    Package: PHP_CodeSniffer
    Operating System: Windows
    Package Version: 1.3.4
    PHP Version: 5.3.14
    Assigned To: squiz
    Roadmap Versions:
    New Comment:

    I've verified this on two windows machines.
    Both were running the PEAR installed 1.3.3 and working correctly.
    When upgraded to 1.3.4 the issue is consistent.

    I actually have this set up in a large source control tree for a
    developer toolset for my team.

    Here's links to output using a patch.

    PATCH:
    https://rovangju.s3.amazonaws.com/misc/phpcs/PHPCS-1.3.4_skipped_sniff_verbosity.patch

    ================================
    OUTPUTS (using -vvv and patch, the registered sniff lists on top are the
    focus obviously)
    ================================
    Custom standard:

    https://rovangju.s3.amazonaws.com/misc/phpcs/OUTPUT-skipped_sniff_verbosity_added.txt

    https://rovangju.s3.amazonaws.com/misc/phpcs/OUTPUT-line_849_patched.txt


    Using the included Squiz standard with patch:
    https://rovangju.s3.amazonaws.com/misc/phpcs/OUTPUT-Squiz-skipped_sniff_verbosity_added.txt


    =============================
    STANDARD:
    =============================
    For brevity, this is the full standard which is installed to the
    'Standards' dir for PHPCS:
    https://rovangju.s3.amazonaws.com/misc/phpcs/MState.zip


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

    [2012-07-10 05:48:48] squiz

    The patch you applied is likely the problem. Even though that one line
    needed to be
    correct to fix that bug, previous fixes made since the release also
    contributed to the
    fix. Please test with the latest git clone to ensure you have all
    Windows fixes.

    If you want to install from a git clone:
    git clone git://github.com/squizlabs/PHP_CodeSniffer.git
    cd PHP_CodeSniffer
    pear uninstall php_codesniffer
    pear install package.xml

    Or, just run PHPCS directly from the clone, so it doesn't touch your
    installed version;
    git clone git://github.com/squizlabs/PHP_CodeSniffer.git
    cd PHP_CodeSniffer
    php scripts/phpcs ...

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

    [2012-07-10 05:23:57] thinice

    - This is with the PEAR package.
    - I patched the one line @834 to fix the issue using the line in my
    report
    - The standard I'm using is home brew and installed in the Standards
    directory alongside Squiz, Generic, PEAR, etc.
    - The standard is the only extra standard not distributed with PEAR
    - The standard has a few custom sniffs, with the majority being
    referenced by the ruleset.xml, most come from Squiz.
    - The Sniffs also all report back for me (which is why it was a bear to
    find)
    - Come run time, the only Sniffs that run are the ones that are custom
    (inferred via directory structure, not from the ruleset.xml)


    I will try to put together a test case and package it up for sample.

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

    [2012-07-10 02:27:07] squiz

    -Status: Assigned
    +Status: Feedback
    I've run the latest git clone version of PHP_CodeSniffer on both Windows
    and OS X
    and get exactly the same results when testing the PEAR, Squiz, Zend and
    Generic
    coding standards over the CodeSniffer.php file.

    To check, I used the -v command line argument so it tells me exactly how
    many
    sniffs were found and registered. The number of sniffs was the same each
    time and
    the number of errors, warnings and notices was also the same.

    Are you using the git clone or a PEAR package? If you have patched your
    own install,
    did you just patch this one change or did you patch all fixes (this
    issue was fixed with
    other previous changes that appear unrelated)? What standard are you
    testing with
    and how many sniffs are registered on Windows vs whatever other OS you
    are
    comparing the results on?

    Sorry for the bunch of questions, but I can't fix this unless I can
    replicate it.

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

    [2012-07-10 00:21:21] squiz

    -Status: Critical
    +Status: Open
    -Assigned To:
    +Assigned To: squiz
    Please don't set the severity of bug reports. I look at all of them no
    matter what they
    are.

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

    [2012-07-09 21:26:52] thinice

    -Summary: CodeSniffer.php and DIRECTORY_SEPARATOR causing
    issues
    +Summary: CodeSniffer.php and DIRECTORY_SEPARATOR change
    causing sniffs to be disregarded


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

    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=19498
  • Thinice at Jul 10, 2012 at 3:53 am
    Edit report at https://pear.php.net/bugs/bug.php?id=19498&edit=1

    ID: 19498
    Comment by: thinice@gmail.com
    Reported By: thinice@gmail.com
    Summary: CodeSniffer.php and DIRECTORY_SEPARATOR change
    causing sniffs to be disregarded
    Status: Feedback
    Type: Bug
    Package: PHP_CodeSniffer
    Operating System: Windows
    Package Version: 1.3.4
    PHP Version: 5.3.14
    Assigned To: squiz
    Roadmap Versions:
    New Comment:

    I will fire up a fresh windows VM and install PHPCS via PEAR to be as
    objective as possible and report back when I get a chance.


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

    [2012-07-10 05:58:30] thinice

    I've verified this on two windows machines.
    Both were running the PEAR installed 1.3.3 and working correctly.
    When upgraded to 1.3.4 the issue is consistent.

    I actually have this set up in a large source control tree for a
    developer toolset for my team.

    Here's links to output using a patch.

    PATCH:
    https://rovangju.s3.amazonaws.com/misc/phpcs/PHPCS-1.3.4_skipped_sniff_verbosity.patch

    ================================
    OUTPUTS (using -vvv and patch, the registered sniff lists on top are the
    focus obviously)
    ================================
    Custom standard:

    https://rovangju.s3.amazonaws.com/misc/phpcs/OUTPUT-skipped_sniff_verbosity_added.txt

    https://rovangju.s3.amazonaws.com/misc/phpcs/OUTPUT-line_849_patched.txt


    Using the included Squiz standard with patch:
    https://rovangju.s3.amazonaws.com/misc/phpcs/OUTPUT-Squiz-skipped_sniff_verbosity_added.txt


    =============================
    STANDARD:
    =============================
    For brevity, this is the full standard which is installed to the
    'Standards' dir for PHPCS:
    https://rovangju.s3.amazonaws.com/misc/phpcs/MState.zip

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

    [2012-07-10 05:48:48] squiz

    The patch you applied is likely the problem. Even though that one line
    needed to be
    correct to fix that bug, previous fixes made since the release also
    contributed to the
    fix. Please test with the latest git clone to ensure you have all
    Windows fixes.

    If you want to install from a git clone:
    git clone git://github.com/squizlabs/PHP_CodeSniffer.git
    cd PHP_CodeSniffer
    pear uninstall php_codesniffer
    pear install package.xml

    Or, just run PHPCS directly from the clone, so it doesn't touch your
    installed version;
    git clone git://github.com/squizlabs/PHP_CodeSniffer.git
    cd PHP_CodeSniffer
    php scripts/phpcs ...

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

    [2012-07-10 05:23:57] thinice

    - This is with the PEAR package.
    - I patched the one line @834 to fix the issue using the line in my
    report
    - The standard I'm using is home brew and installed in the Standards
    directory alongside Squiz, Generic, PEAR, etc.
    - The standard is the only extra standard not distributed with PEAR
    - The standard has a few custom sniffs, with the majority being
    referenced by the ruleset.xml, most come from Squiz.
    - The Sniffs also all report back for me (which is why it was a bear to
    find)
    - Come run time, the only Sniffs that run are the ones that are custom
    (inferred via directory structure, not from the ruleset.xml)


    I will try to put together a test case and package it up for sample.

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

    [2012-07-10 02:27:07] squiz

    -Status: Assigned
    +Status: Feedback
    I've run the latest git clone version of PHP_CodeSniffer on both Windows
    and OS X
    and get exactly the same results when testing the PEAR, Squiz, Zend and
    Generic
    coding standards over the CodeSniffer.php file.

    To check, I used the -v command line argument so it tells me exactly how
    many
    sniffs were found and registered. The number of sniffs was the same each
    time and
    the number of errors, warnings and notices was also the same.

    Are you using the git clone or a PEAR package? If you have patched your
    own install,
    did you just patch this one change or did you patch all fixes (this
    issue was fixed with
    other previous changes that appear unrelated)? What standard are you
    testing with
    and how many sniffs are registered on Windows vs whatever other OS you
    are
    comparing the results on?

    Sorry for the bunch of questions, but I can't fix this unless I can
    replicate it.

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

    [2012-07-10 00:21:21] squiz

    -Status: Critical
    +Status: Open
    -Assigned To:
    +Assigned To: squiz
    Please don't set the severity of bug reports. I look at all of them no
    matter what they
    are.

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

    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=19498
  • Thinice at Jul 10, 2012 at 3:55 am
    Edit report at https://pear.php.net/bugs/bug.php?id=19498&edit=1

    ID: 19498
    Comment by: thinice@gmail.com
    Reported By: thinice@gmail.com
    Summary: CodeSniffer.php and DIRECTORY_SEPARATOR change
    causing sniffs to be disregarded
    Status: Feedback
    Type: Bug
    Package: PHP_CodeSniffer
    Operating System: Windows
    Package Version: 1.3.4
    PHP Version: 5.3.14
    Assigned To: squiz
    Roadmap Versions:
    New Comment:

    My previous comments are not regarding the git copy you just mentioned -
    Just to ensure there's no race condition in our communication :)

    I'll test now with the git copy.


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

    [2012-07-10 05:59:27] thinice

    I will fire up a fresh windows VM and install PHPCS via PEAR to be as
    objective as possible and report back when I get a chance.

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

    [2012-07-10 05:58:30] thinice

    I've verified this on two windows machines.
    Both were running the PEAR installed 1.3.3 and working correctly.
    When upgraded to 1.3.4 the issue is consistent.

    I actually have this set up in a large source control tree for a
    developer toolset for my team.

    Here's links to output using a patch.

    PATCH:
    https://rovangju.s3.amazonaws.com/misc/phpcs/PHPCS-1.3.4_skipped_sniff_verbosity.patch

    ================================
    OUTPUTS (using -vvv and patch, the registered sniff lists on top are the
    focus obviously)
    ================================
    Custom standard:

    https://rovangju.s3.amazonaws.com/misc/phpcs/OUTPUT-skipped_sniff_verbosity_added.txt

    https://rovangju.s3.amazonaws.com/misc/phpcs/OUTPUT-line_849_patched.txt


    Using the included Squiz standard with patch:
    https://rovangju.s3.amazonaws.com/misc/phpcs/OUTPUT-Squiz-skipped_sniff_verbosity_added.txt


    =============================
    STANDARD:
    =============================
    For brevity, this is the full standard which is installed to the
    'Standards' dir for PHPCS:
    https://rovangju.s3.amazonaws.com/misc/phpcs/MState.zip

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

    [2012-07-10 05:48:48] squiz

    The patch you applied is likely the problem. Even though that one line
    needed to be
    correct to fix that bug, previous fixes made since the release also
    contributed to the
    fix. Please test with the latest git clone to ensure you have all
    Windows fixes.

    If you want to install from a git clone:
    git clone git://github.com/squizlabs/PHP_CodeSniffer.git
    cd PHP_CodeSniffer
    pear uninstall php_codesniffer
    pear install package.xml

    Or, just run PHPCS directly from the clone, so it doesn't touch your
    installed version;
    git clone git://github.com/squizlabs/PHP_CodeSniffer.git
    cd PHP_CodeSniffer
    php scripts/phpcs ...

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

    [2012-07-10 05:23:57] thinice

    - This is with the PEAR package.
    - I patched the one line @834 to fix the issue using the line in my
    report
    - The standard I'm using is home brew and installed in the Standards
    directory alongside Squiz, Generic, PEAR, etc.
    - The standard is the only extra standard not distributed with PEAR
    - The standard has a few custom sniffs, with the majority being
    referenced by the ruleset.xml, most come from Squiz.
    - The Sniffs also all report back for me (which is why it was a bear to
    find)
    - Come run time, the only Sniffs that run are the ones that are custom
    (inferred via directory structure, not from the ruleset.xml)


    I will try to put together a test case and package it up for sample.

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

    [2012-07-10 02:27:07] squiz

    -Status: Assigned
    +Status: Feedback
    I've run the latest git clone version of PHP_CodeSniffer on both Windows
    and OS X
    and get exactly the same results when testing the PEAR, Squiz, Zend and
    Generic
    coding standards over the CodeSniffer.php file.

    To check, I used the -v command line argument so it tells me exactly how
    many
    sniffs were found and registered. The number of sniffs was the same each
    time and
    the number of errors, warnings and notices was also the same.

    Are you using the git clone or a PEAR package? If you have patched your
    own install,
    did you just patch this one change or did you patch all fixes (this
    issue was fixed with
    other previous changes that appear unrelated)? What standard are you
    testing with
    and how many sniffs are registered on Windows vs whatever other OS you
    are
    comparing the results on?

    Sorry for the bunch of questions, but I can't fix this unless I can
    replicate it.

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

    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=19498
  • Thinice at Jul 10, 2012 at 4:02 am
    Edit report at https://pear.php.net/bugs/bug.php?id=19498&edit=1

    ID: 19498
    Comment by: thinice@gmail.com
    Reported By: thinice@gmail.com
    Summary: CodeSniffer.php and DIRECTORY_SEPARATOR change
    causing sniffs to be disregarded
    Status: Feedback
    Type: Bug
    Package: PHP_CodeSniffer
    Operating System: Windows
    Package Version: 1.3.4
    PHP Version: 5.3.14
    Assigned To: squiz
    Roadmap Versions:
    New Comment:

    Git copy works without issues.

    Should I start to make it practice to just get the copy from the
    Squizlabs git repo?

    I'm not attuned to how the release cycle is for PHPCS on Pear but it
    looks like there's some good upgrades sitting out there in your git repo
    (PSR1/2, etc)


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

    [2012-07-10 06:01:23] thinice

    My previous comments are not regarding the git copy you just mentioned -
    Just to ensure there's no race condition in our communication :)

    I'll test now with the git copy.

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

    [2012-07-10 05:59:27] thinice

    I will fire up a fresh windows VM and install PHPCS via PEAR to be as
    objective as possible and report back when I get a chance.

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

    [2012-07-10 05:58:30] thinice

    I've verified this on two windows machines.
    Both were running the PEAR installed 1.3.3 and working correctly.
    When upgraded to 1.3.4 the issue is consistent.

    I actually have this set up in a large source control tree for a
    developer toolset for my team.

    Here's links to output using a patch.

    PATCH:
    https://rovangju.s3.amazonaws.com/misc/phpcs/PHPCS-1.3.4_skipped_sniff_verbosity.patch

    ================================
    OUTPUTS (using -vvv and patch, the registered sniff lists on top are the
    focus obviously)
    ================================
    Custom standard:

    https://rovangju.s3.amazonaws.com/misc/phpcs/OUTPUT-skipped_sniff_verbosity_added.txt

    https://rovangju.s3.amazonaws.com/misc/phpcs/OUTPUT-line_849_patched.txt


    Using the included Squiz standard with patch:
    https://rovangju.s3.amazonaws.com/misc/phpcs/OUTPUT-Squiz-skipped_sniff_verbosity_added.txt


    =============================
    STANDARD:
    =============================
    For brevity, this is the full standard which is installed to the
    'Standards' dir for PHPCS:
    https://rovangju.s3.amazonaws.com/misc/phpcs/MState.zip

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

    [2012-07-10 05:48:48] squiz

    The patch you applied is likely the problem. Even though that one line
    needed to be
    correct to fix that bug, previous fixes made since the release also
    contributed to the
    fix. Please test with the latest git clone to ensure you have all
    Windows fixes.

    If you want to install from a git clone:
    git clone git://github.com/squizlabs/PHP_CodeSniffer.git
    cd PHP_CodeSniffer
    pear uninstall php_codesniffer
    pear install package.xml

    Or, just run PHPCS directly from the clone, so it doesn't touch your
    installed version;
    git clone git://github.com/squizlabs/PHP_CodeSniffer.git
    cd PHP_CodeSniffer
    php scripts/phpcs ...

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

    [2012-07-10 05:23:57] thinice

    - This is with the PEAR package.
    - I patched the one line @834 to fix the issue using the line in my
    report
    - The standard I'm using is home brew and installed in the Standards
    directory alongside Squiz, Generic, PEAR, etc.
    - The standard is the only extra standard not distributed with PEAR
    - The standard has a few custom sniffs, with the majority being
    referenced by the ruleset.xml, most come from Squiz.
    - The Sniffs also all report back for me (which is why it was a bear to
    find)
    - Come run time, the only Sniffs that run are the ones that are custom
    (inferred via directory structure, not from the ruleset.xml)


    I will try to put together a test case and package it up for sample.

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

    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=19498
  • Gsherwood at Jul 10, 2012 at 4:07 am
    Edit report at https://pear.php.net/bugs/bug.php?id=19498&edit=1

    ID: 19498
    Updated by: gsherwood@squiz.net
    Reported By: thinice@gmail.com
    Summary: CodeSniffer.php and DIRECTORY_SEPARATOR change
    causing sniffs to be disregarded
    -Status: Feedback
    +Status: Duplicate
    Type: Bug
    Package: PHP_CodeSniffer
    Operating System: Windows
    Package Version: 1.3.4
    PHP Version: 5.3.14
    Assigned To: squiz
    Roadmap Versions:
    New Comment:

    -Status: Feedback
    +Status: Duplicate
    Glad the clone is working for you. Thanks for getting back to me.

    The git repo is always stable code and you can use it at any time. I
    release and work
    on PHPCS when I get time, and my time is quite limited at the moment.
    But there will
    be a release sometime this week if I get a break.

    Going to mark this as a duplicate of bug 19471.


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

    [2012-07-10 06:07:54] thinice

    Git copy works without issues.

    Should I start to make it practice to just get the copy from the
    Squizlabs git repo?

    I'm not attuned to how the release cycle is for PHPCS on Pear but it
    looks like there's some good upgrades sitting out there in your git repo
    (PSR1/2, etc)

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

    [2012-07-10 06:01:23] thinice

    My previous comments are not regarding the git copy you just mentioned -
    Just to ensure there's no race condition in our communication :)

    I'll test now with the git copy.

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

    [2012-07-10 05:59:27] thinice

    I will fire up a fresh windows VM and install PHPCS via PEAR to be as
    objective as possible and report back when I get a chance.

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

    [2012-07-10 05:58:30] thinice

    I've verified this on two windows machines.
    Both were running the PEAR installed 1.3.3 and working correctly.
    When upgraded to 1.3.4 the issue is consistent.

    I actually have this set up in a large source control tree for a
    developer toolset for my team.

    Here's links to output using a patch.

    PATCH:
    https://rovangju.s3.amazonaws.com/misc/phpcs/PHPCS-1.3.4_skipped_sniff_verbosity.patch

    ================================
    OUTPUTS (using -vvv and patch, the registered sniff lists on top are the
    focus obviously)
    ================================
    Custom standard:

    https://rovangju.s3.amazonaws.com/misc/phpcs/OUTPUT-skipped_sniff_verbosity_added.txt

    https://rovangju.s3.amazonaws.com/misc/phpcs/OUTPUT-line_849_patched.txt


    Using the included Squiz standard with patch:
    https://rovangju.s3.amazonaws.com/misc/phpcs/OUTPUT-Squiz-skipped_sniff_verbosity_added.txt


    =============================
    STANDARD:
    =============================
    For brevity, this is the full standard which is installed to the
    'Standards' dir for PHPCS:
    https://rovangju.s3.amazonaws.com/misc/phpcs/MState.zip

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

    [2012-07-10 05:48:48] squiz

    The patch you applied is likely the problem. Even though that one line
    needed to be
    correct to fix that bug, previous fixes made since the release also
    contributed to the
    fix. Please test with the latest git clone to ensure you have all
    Windows fixes.

    If you want to install from a git clone:
    git clone git://github.com/squizlabs/PHP_CodeSniffer.git
    cd PHP_CodeSniffer
    pear uninstall php_codesniffer
    pear install package.xml

    Or, just run PHPCS directly from the clone, so it doesn't touch your
    installed version;
    git clone git://github.com/squizlabs/PHP_CodeSniffer.git
    cd PHP_CodeSniffer
    php scripts/phpcs ...

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

    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=19498

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedJul 9, '12 at 7:16p
activeJul 10, '12 at 4:07a
posts12
users3
websitepear.php.net

3 users in discussion

Thinice: 4 posts Gsherwood: 4 posts Thinice: 4 posts

People

Translate

site design / logo © 2022 Grokbase