Skip to content

Commit

Permalink
Merge pull request #1225 from nextcloud/allow-to-validate-password-po…
Browse files Browse the repository at this point in the history
…licy

Allow to validate the password_policy app
  • Loading branch information
rullzer committed Sep 2, 2016
2 parents 3209a81 + de96c5b commit 7e13db9
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/private/App/CodeChecker/CodeChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,25 @@ public function analyse($appId) {
throw new \RuntimeException("No app with given id <$appId> known.");
}

return $this->analyseFolder($appPath);
return $this->analyseFolder($appId, $appPath);
}

/**
* @param string $appId
* @param string $folder
* @return array
*/
public function analyseFolder($folder) {
public function analyseFolder($appId, $folder) {
$errors = [];

$excludedDirectories = ['vendor', '3rdparty', '.git', 'l10n', 'tests', 'test'];
if ($appId === 'password_policy') {
$excludedDirectories[] = 'lists';
}

$excludes = array_map(function($item) use ($folder) {
return $folder . '/' . $item;
}, ['vendor', '3rdparty', '.git', 'l10n', 'tests', 'test']);
}, $excludedDirectories);

$iterator = new RecursiveDirectoryIterator($folder, RecursiveDirectoryIterator::SKIP_DOTS);
$iterator = new RecursiveCallbackFilterIterator($iterator, function($item) use ($folder, $excludes){
Expand Down

0 comments on commit 7e13db9

Please sign in to comment.