Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 3.7.2

Bug #19968 Permission denied on excluded directory
Submitted: 2013-06-04 23:57 UTC
From: hairmenu Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.4.5)
PHP Version: 5.3.10 OS: linux
Roadmaps: (Not assigned)    
Subscription  


 [2013-06-04 23:57 UTC] hairmenu (me and myself)
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

Comments

 [2013-06-19 12:50 UTC] squiz (Greg Sherwood)
-Summary: exclude directory and forcing directory +Summary: Permission denied on excluded directory -Assigned To: +Assigned To: squiz
 [2013-06-19 12:53 UTC] squiz (Greg Sherwood)
-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