Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix sniff registration when a hidden directory appears in the path. #229

Merged
merged 1 commit into from

2 participants

@klausi

Drupal people install their standard in the hidden .composer directory and then the sniffs are not found.

@gsherwood gsherwood merged commit e92429d into squizlabs:phpcs-fixer
@gsherwood
Owner

Fix looks good. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 2 deletions.
  1. +5 −2 CodeSniffer.php
View
7 CodeSniffer.php
@@ -853,8 +853,11 @@ private function _expandSniffDirectory($directory, $depth=0)
$path = $file->getPathname();
- // Skip files in hidden directories.
- if (strpos($path, DIRECTORY_SEPARATOR.'.') !== false) {
+ // Skip files in hidden directories within the Sniffs directory of this
+ // standard. We use the offset with strpos() to allow hidden directories
+ // before, valid example:
+ // /home/klausi/.composer/vendor/drupal/coder/coder_sniffer/Drupal/Sniffs
+ if (strpos($path, DIRECTORY_SEPARATOR.'.', strlen($directory)) !== false) {
continue;
}
Something went wrong with that request. Please try again.