Skip to content
Permalink
Browse files

Fix #1619 - prevent tests from being added automatically on --init

  • Loading branch information...
muglug committed May 10, 2019
1 parent 9b75683 commit 48d624e3058a18b9285160814e5b09c58bc7e0b7
Showing with 9 additions and 2 deletions.
  1. +9 −2 src/Psalm/Config/Creator.php
@@ -88,6 +88,7 @@ private static function getPsr4Paths(string $current_dir, array $composer_json)
$paths = [$paths];
}
/** @var string $path */
foreach ($paths as $path) {
if ($path === '') {
/** @var string[] */
@@ -106,7 +107,7 @@ private static function getPsr4Paths(string $current_dir, array $composer_json)
array_shift($parts);
}
if ($parts[0] === 'vendor') {
if ($parts[0] === 'vendor' || $parts[0] === 'tests') {
continue;
}
@@ -116,7 +117,13 @@ private static function getPsr4Paths(string $current_dir, array $composer_json)
$nodes[] = '<file name="' . $parts[0] . '" />';
}
}
} else {
continue;
}
$path = preg_replace('@[\\\\/]$@', '', $path);
if ($path !== 'tests') {
$nodes[] = '<directory name="' . $path . '" />';
}
}

0 comments on commit 48d624e

Please sign in to comment.
You can’t perform that action at this time.