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

  ID: 19968
  Updated by: gsherwood@squiz.net
  Reported By: hairmenu@hotmail.com
-Summary: exclude directory and forcing directory
+Summary: Permission denied on excluded directory
  Status: Open
  Type: Bug
  Package: PHP_CodeSniffer
  Operating System: linux
  Package Version: 1.4.5
  PHP Version: 5.3.10
-Assigned To:
+Assigned To: squiz
  Roadmap Versions:
  New Comment:

-Summary: exclude directory and forcing directory
+Summary: Permission denied on excluded directory
-Assigned To:
+Assigned To: squiz



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

[2013-06-04 19:57:31] hairmenu

Description:
------------
In a ruleset.xml, i excluded a directory
<exclude-pattern>*/tests/*</exclude-pattern>

Still, when i run phpcs i want to limit it to one directory so i do
'phpcs .myfolder'

Problem: phpcs tries to scan the 'tests' folder despite the
exclude pattern. And if some of the dir are not readable, a
error is triggered and phpcs stops:

  Uncaught exception 'UnexpectedValueException' with
message
'RecursiveDirectoryIterator::__construct(/path_to_my_unread
able_folder): failed to open dir: Permission denied' in
/usr/share/php/PHP/CodeSniffer.php:734


Expected result:
----------------
excluded folders should even be parsed

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

Search Discussions

  • Gsherwood at Jun 19, 2013 at 6:49 am
    Edit report at https://pear.php.net/bugs/bug.php?id=19968&edit=1

      ID: 19968
      Updated by: gsherwood@squiz.net
      Reported By: hairmenu@hotmail.com
      Summary: Permission denied on excluded directory
    -Status: Assigned
    +Status: Closed
      Type: Bug
      Package: PHP_CodeSniffer
      Operating System: linux
      Package Version: 1.4.5
      PHP Version: 5.3.10
      Assigned To: squiz
      Roadmap Versions:
      New Comment:

    -Status: Assigned
    +Status: Closed
    PHPCS wasn't actually trying to go into the directories as it checks if
    the path is
    excluded before processing. But the iterator that is used fails before
    the path can be
    checked. Luckily, there is an optional flag you can use to ignore these
    errors.

    Fix committed to github repo:
    https://github.com/squizlabs/PHP_CodeSniffer/commit/363cadec12b11583a10293dbd
    463db8fe60c54ed


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

    [2013-06-19 08:50:38] squiz

    -Summary: exclude directory and forcing directory
    +Summary: Permission denied on excluded directory
    -Assigned To:
    +Assigned To: squiz


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

    [2013-06-04 19:57:31] hairmenu

    Description:
    ------------
    In a ruleset.xml, i excluded a directory
    <exclude-pattern>*/tests/*</exclude-pattern>

    Still, when i run phpcs i want to limit it to one directory so i do
    'phpcs .myfolder'

    Problem: phpcs tries to scan the 'tests' folder despite the
    exclude pattern. And if some of the dir are not readable, a
    error is triggered and phpcs stops:

      Uncaught exception 'UnexpectedValueException' with
    message
    'RecursiveDirectoryIterator::__construct(/path_to_my_unread
    able_folder): failed to open dir: Permission denied' in
    /usr/share/php/PHP/CodeSniffer.php:734


    Expected result:
    ----------------
    excluded folders should even be parsed

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedJun 19, '13 at 6:47a
activeJun 19, '13 at 6:49a
posts2
users1
websitepear.php.net

1 user in discussion

Gsherwood: 2 posts

People

Translate

site design / logo © 2022 Grokbase