]> source.dussan.org Git - nextcloud-server.git/commitdiff
Allow to validate the password_policy app 1322/head
authorJoas Schilling <coding@schilljs.com>
Thu, 1 Sep 2016 08:18:00 +0000 (10:18 +0200)
committerJoas Schilling <coding@schilljs.com>
Thu, 8 Sep 2016 07:56:48 +0000 (09:56 +0200)
lib/private/App/CodeChecker/CodeChecker.php

index 569a452df7327a8d9e7dfef03e89c5629a4711de..5a3cc3122cba38eb425f4a73639e69eaaf259fa2 100644 (file)
@@ -68,19 +68,25 @@ class CodeChecker extends BasicEmitter {
                        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){