From 93fc7fcdbef0fdd0fda1ea2be9047817bb68524c Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 9 May 2017 15:46:33 +0200 Subject: [PATCH 1/8] Check the syntax of the language file Signed-off-by: Joas Schilling --- core/Command/App/CheckCode.php | 10 ++++ lib/composer/composer/autoload_classmap.php | 1 + lib/composer/composer/autoload_static.php | 1 + .../App/CodeChecker/LanguageParseChecker.php | 56 +++++++++++++++++++ 4 files changed, 68 insertions(+) create mode 100644 lib/private/App/CodeChecker/LanguageParseChecker.php diff --git a/core/Command/App/CheckCode.php b/core/Command/App/CheckCode.php index aa618b26cec..1effed99566 100644 --- a/core/Command/App/CheckCode.php +++ b/core/Command/App/CheckCode.php @@ -28,6 +28,7 @@ namespace OC\Core\Command\App; use OC\App\CodeChecker\CodeChecker; use OC\App\CodeChecker\EmptyCheck; use OC\App\CodeChecker\InfoChecker; +use OC\App\CodeChecker\LanguageParseChecker; use OC\App\InfoParser; use Stecman\Component\Symfony\Console\BashCompletion\Completion\CompletionAwareInterface; use Stecman\Component\Symfony\Console\BashCompletion\CompletionContext; @@ -171,6 +172,15 @@ class CheckCode extends Command implements CompletionAwareInterface { $infoErrors = $infoChecker->analyse($appId); $errors = array_merge($errors, $infoErrors); + + $languageParser = new LanguageParseChecker(); + $languageErrors = $languageParser->analyse($appId); + + foreach ($languageErrors as $languageError) { + $output->writeln("$languageError"); + } + + $errors = array_merge($errors, $languageErrors); } $this->analyseUpdateFile($appId, $output); diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index 59cac3db775..19380f6571b 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -336,6 +336,7 @@ return array( 'OC\\App\\CodeChecker\\EmptyCheck' => $baseDir . '/lib/private/App/CodeChecker/EmptyCheck.php', 'OC\\App\\CodeChecker\\ICheck' => $baseDir . '/lib/private/App/CodeChecker/ICheck.php', 'OC\\App\\CodeChecker\\InfoChecker' => $baseDir . '/lib/private/App/CodeChecker/InfoChecker.php', + 'OC\\App\\CodeChecker\\LanguageParseChecker' => $baseDir . '/lib/private/App/CodeChecker/LanguageParseChecker.php', 'OC\\App\\CodeChecker\\NodeVisitor' => $baseDir . '/lib/private/App/CodeChecker/NodeVisitor.php', 'OC\\App\\CodeChecker\\PrivateCheck' => $baseDir . '/lib/private/App/CodeChecker/PrivateCheck.php', 'OC\\App\\CodeChecker\\StrongComparisonCheck' => $baseDir . '/lib/private/App/CodeChecker/StrongComparisonCheck.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index b7e584c324a..46285356489 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -366,6 +366,7 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c 'OC\\App\\CodeChecker\\EmptyCheck' => __DIR__ . '/../../..' . '/lib/private/App/CodeChecker/EmptyCheck.php', 'OC\\App\\CodeChecker\\ICheck' => __DIR__ . '/../../..' . '/lib/private/App/CodeChecker/ICheck.php', 'OC\\App\\CodeChecker\\InfoChecker' => __DIR__ . '/../../..' . '/lib/private/App/CodeChecker/InfoChecker.php', + 'OC\\App\\CodeChecker\\LanguageParseChecker' => __DIR__ . '/../../..' . '/lib/private/App/CodeChecker/LanguageParseChecker.php', 'OC\\App\\CodeChecker\\NodeVisitor' => __DIR__ . '/../../..' . '/lib/private/App/CodeChecker/NodeVisitor.php', 'OC\\App\\CodeChecker\\PrivateCheck' => __DIR__ . '/../../..' . '/lib/private/App/CodeChecker/PrivateCheck.php', 'OC\\App\\CodeChecker\\StrongComparisonCheck' => __DIR__ . '/../../..' . '/lib/private/App/CodeChecker/StrongComparisonCheck.php', diff --git a/lib/private/App/CodeChecker/LanguageParseChecker.php b/lib/private/App/CodeChecker/LanguageParseChecker.php new file mode 100644 index 00000000000..29331d1e648 --- /dev/null +++ b/lib/private/App/CodeChecker/LanguageParseChecker.php @@ -0,0 +1,56 @@ + + * + * @author Joas Schilling + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +namespace OC\App\CodeChecker; + +class LanguageParseChecker { + + /** + * @param string $appId + * @return array + */ + public function analyse($appId) { + $appPath = \OC_App::getAppPath($appId); + if ($appPath === false) { + throw new \RuntimeException("No app with given id <$appId> known."); + } + + $errors = []; + $directory = new \DirectoryIterator($appPath . '/l10n/'); + + foreach ($directory as $file) { + if ($file->getExtension() !== 'json') { + continue; + } + + $content = file_get_contents($file->getPathname()); + json_decode($content, true); + + if (json_last_error() !== JSON_ERROR_NONE) { + $errors[] = 'Invalid language file found: l10n/' . $file->getFilename() . ': ' . json_last_error_msg(); + } + } + + return $errors; + } +} From 31bb65fa360d1f6bb5fb5e4569160e8f006b841a Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 9 May 2017 16:49:56 +0200 Subject: [PATCH 2/8] Check the name length of database items Signed-off-by: Joas Schilling --- core/Command/App/CheckCode.php | 13 +++ lib/composer/composer/autoload_classmap.php | 1 + lib/composer/composer/autoload_static.php | 1 + .../App/CodeChecker/DatabaseSchemaChecker.php | 107 ++++++++++++++++++ 4 files changed, 122 insertions(+) create mode 100644 lib/private/App/CodeChecker/DatabaseSchemaChecker.php diff --git a/core/Command/App/CheckCode.php b/core/Command/App/CheckCode.php index 1effed99566..f787529bef9 100644 --- a/core/Command/App/CheckCode.php +++ b/core/Command/App/CheckCode.php @@ -26,6 +26,7 @@ namespace OC\Core\Command\App; use OC\App\CodeChecker\CodeChecker; +use OC\App\CodeChecker\DatabaseSchemaChecker; use OC\App\CodeChecker\EmptyCheck; use OC\App\CodeChecker\InfoChecker; use OC\App\CodeChecker\LanguageParseChecker; @@ -181,6 +182,18 @@ class CheckCode extends Command implements CompletionAwareInterface { } $errors = array_merge($errors, $languageErrors); + + $databaseSchema = new DatabaseSchemaChecker(); + $schemaErrors = $databaseSchema->analyse($appId); + + foreach ($schemaErrors['errors'] as $schemaError) { + $output->writeln("$schemaError"); + } + foreach ($schemaErrors['warnings'] as $schemaWarning) { + $output->writeln("$schemaWarning"); + } + + $errors = array_merge($errors, $schemaErrors['errors']); } $this->analyseUpdateFile($appId, $output); diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index 19380f6571b..10233f07a2a 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -332,6 +332,7 @@ return array( 'OC\\App\\AppStore\\Version\\VersionParser' => $baseDir . '/lib/private/App/AppStore/Version/VersionParser.php', 'OC\\App\\CodeChecker\\AbstractCheck' => $baseDir . '/lib/private/App/CodeChecker/AbstractCheck.php', 'OC\\App\\CodeChecker\\CodeChecker' => $baseDir . '/lib/private/App/CodeChecker/CodeChecker.php', + 'OC\\App\\CodeChecker\\DatabaseSchemaChecker' => $baseDir . '/lib/private/App/CodeChecker/DatabaseSchemaChecker.php', 'OC\\App\\CodeChecker\\DeprecationCheck' => $baseDir . '/lib/private/App/CodeChecker/DeprecationCheck.php', 'OC\\App\\CodeChecker\\EmptyCheck' => $baseDir . '/lib/private/App/CodeChecker/EmptyCheck.php', 'OC\\App\\CodeChecker\\ICheck' => $baseDir . '/lib/private/App/CodeChecker/ICheck.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index 46285356489..9c0f0871133 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -362,6 +362,7 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c 'OC\\App\\AppStore\\Version\\VersionParser' => __DIR__ . '/../../..' . '/lib/private/App/AppStore/Version/VersionParser.php', 'OC\\App\\CodeChecker\\AbstractCheck' => __DIR__ . '/../../..' . '/lib/private/App/CodeChecker/AbstractCheck.php', 'OC\\App\\CodeChecker\\CodeChecker' => __DIR__ . '/../../..' . '/lib/private/App/CodeChecker/CodeChecker.php', + 'OC\\App\\CodeChecker\\DatabaseSchemaChecker' => __DIR__ . '/../../..' . '/lib/private/App/CodeChecker/DatabaseSchemaChecker.php', 'OC\\App\\CodeChecker\\DeprecationCheck' => __DIR__ . '/../../..' . '/lib/private/App/CodeChecker/DeprecationCheck.php', 'OC\\App\\CodeChecker\\EmptyCheck' => __DIR__ . '/../../..' . '/lib/private/App/CodeChecker/EmptyCheck.php', 'OC\\App\\CodeChecker\\ICheck' => __DIR__ . '/../../..' . '/lib/private/App/CodeChecker/ICheck.php', diff --git a/lib/private/App/CodeChecker/DatabaseSchemaChecker.php b/lib/private/App/CodeChecker/DatabaseSchemaChecker.php new file mode 100644 index 00000000000..30226139b19 --- /dev/null +++ b/lib/private/App/CodeChecker/DatabaseSchemaChecker.php @@ -0,0 +1,107 @@ + + * + * @author Joas Schilling + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +namespace OC\App\CodeChecker; + +class DatabaseSchemaChecker { + + /** + * @param string $appId + * @return array + */ + public function analyse($appId) { + $appPath = \OC_App::getAppPath($appId); + if ($appPath === false) { + throw new \RuntimeException("No app with given id <$appId> known."); + } + + if (!file_exists($appPath . '/appinfo/database.xml')) { + return ['errors' => [], 'warnings' => []]; + } + + libxml_use_internal_errors(true); + $loadEntities = libxml_disable_entity_loader(false); + $xml = simplexml_load_file($appPath . '/appinfo/database.xml'); + libxml_disable_entity_loader($loadEntities); + + + $errors = $warnings = []; + + foreach ($xml->table as $table) { + // Table names + if (strpos($table->name, '*dbprefix*') !== 0) { + $errors[] = 'Database schema error: name of table ' . $table->name . ' does not start with *dbprefix*'; + } + $tableName = substr($table->name, strlen('*dbprefix*')); + if (strpos($tableName, '*dbprefix*') !== false) { + $warnings[] = 'Database schema warning: *dbprefix* should only appear once in name of table ' . $table->name; + } + + if (strlen($tableName) > 27) { + $errors[] = 'Database schema error: Name of table ' . $table->name . ' is too long (' . strlen($tableName) . '), max. 27 characters (21 characters for tables with autoincrement) + *dbprefix* allowed'; + } + + $hasAutoIncrement = false; + + // Column names + foreach ($table->declaration->field as $column) { + if (strpos($column->name, '*dbprefix*') !== false) { + $warnings[] = 'Database schema warning: *dbprefix* should not appear in name of column ' . $column->name . ' on table ' . $table->name; + } + + if (strlen($column->name) > 30) { + $errors[] = 'Database schema error: Name of column ' . $column->name . ' on table ' . $table->name . ' is too long (' . strlen($tableName) . '), max. 30 characters allowed'; + } + + if ($column->autoincrement) { + if ($hasAutoIncrement) { + $errors[] = 'Database schema error: Table ' . $table->name . ' has multiple autoincrement columns'; + } + + if (strlen($tableName) > 21) { + $errors[] = 'Database schema error: Name of table ' . $table->name . ' is too long (' . strlen($tableName) . '), max. 27 characters (21 characters for tables with autoincrement) + *dbprefix* allowed'; + } + + $hasAutoIncrement = true; + } + } + + // Index names + foreach ($table->declaration->index as $index) { + if (strpos($index->name, '*dbprefix*') !== 0) { + $warnings[] = 'Database schema warning: name of index ' . $index->name . ' on table ' . $table->name . ' does not start with *dbprefix*'; + } + $indexName = substr($index->name, strlen('*dbprefix*')); + if (strpos($indexName, '*dbprefix*') !== false) { + $warnings[] = 'Database schema warning: *dbprefix* should only appear once in name of index ' . $index->name . ' on table ' . $table->name; + } + + if (strlen($indexName) > 27) { + $errors[] = 'Database schema error: Name of index ' . $index->name . ' on table ' . $table->name . ' is too long (' . strlen($tableName) . '), max. 27 characters + *dbprefix* allowed'; + } + } + } + + return ['errors' => $errors, 'warnings' => $warnings]; + } +} From 8e757b343d92da5b53725f4574f8a222710a8864 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 9 May 2017 17:22:59 +0200 Subject: [PATCH 3/8] Fix apps without translations Signed-off-by: Joas Schilling --- lib/private/App/CodeChecker/LanguageParseChecker.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/private/App/CodeChecker/LanguageParseChecker.php b/lib/private/App/CodeChecker/LanguageParseChecker.php index 29331d1e648..35354869339 100644 --- a/lib/private/App/CodeChecker/LanguageParseChecker.php +++ b/lib/private/App/CodeChecker/LanguageParseChecker.php @@ -35,6 +35,10 @@ class LanguageParseChecker { throw new \RuntimeException("No app with given id <$appId> known."); } + if (!is_dir($appPath . '/l10n/')) { + return []; + } + $errors = []; $directory = new \DirectoryIterator($appPath . '/l10n/'); From 1951c88bdcc201078968613743229e4d97204855 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 10 May 2017 12:35:14 +0200 Subject: [PATCH 4/8] We don't use the prefix on index names Signed-off-by: Joas Schilling --- lib/private/App/CodeChecker/DatabaseSchemaChecker.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/private/App/CodeChecker/DatabaseSchemaChecker.php b/lib/private/App/CodeChecker/DatabaseSchemaChecker.php index 30226139b19..1255dec25c1 100644 --- a/lib/private/App/CodeChecker/DatabaseSchemaChecker.php +++ b/lib/private/App/CodeChecker/DatabaseSchemaChecker.php @@ -88,14 +88,12 @@ class DatabaseSchemaChecker { // Index names foreach ($table->declaration->index as $index) { - if (strpos($index->name, '*dbprefix*') !== 0) { - $warnings[] = 'Database schema warning: name of index ' . $index->name . ' on table ' . $table->name . ' does not start with *dbprefix*'; - } - $indexName = substr($index->name, strlen('*dbprefix*')); - if (strpos($indexName, '*dbprefix*') !== false) { - $warnings[] = 'Database schema warning: *dbprefix* should only appear once in name of index ' . $index->name . ' on table ' . $table->name; + $hasPrefix = strpos($index->name, '*dbprefix*'); + if ($hasPrefix !== false && $hasPrefix !== 0) { + $warnings[] = 'Database schema warning: *dbprefix* should only appear at the beginning in name of index ' . $index->name . ' on table ' . $table->name; } + $indexName = $hasPrefix === 0 ? substr($index->name, strlen('*dbprefix*')) : $index->name; if (strlen($indexName) > 27) { $errors[] = 'Database schema error: Name of index ' . $index->name . ' on table ' . $table->name . ' is too long (' . strlen($tableName) . '), max. 27 characters + *dbprefix* allowed'; } From 3571355eb579e0a7a027ef9bcb83a2c24f1751aa Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 10 May 2017 13:54:36 +0200 Subject: [PATCH 5/8] Run the app checker on all apps Signed-off-by: Joas Schilling --- .drone.yml | 13 +------------ autotest-checkers.sh | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 12 deletions(-) create mode 100755 autotest-checkers.sh diff --git a/.drone.yml b/.drone.yml index 2080de5a123..90ac6e4e417 100644 --- a/.drone.yml +++ b/.drone.yml @@ -15,18 +15,7 @@ pipeline: checkers: image: nextcloudci/php7.0:php7.0-7 commands: - - bash ./build/autoloaderchecker.sh - - bash ./build/mergejschecker.sh - - php ./build/translation-checker.php - - php ./build/htaccess-checker.php - - ./occ app:check-code admin_audit - - ./occ app:check-code comments - - ./occ app:check-code federation - - ./occ app:check-code sharebymail - - ./occ app:check-code systemtags - - ./occ app:check-code theming - - ./occ app:check-code workflowengine - - php ./build/signed-off-checker.php + - ./autotest-checkers.sh when: matrix: TESTS: checkers diff --git a/autotest-checkers.sh b/autotest-checkers.sh new file mode 100755 index 00000000000..ff89eba2b5e --- /dev/null +++ b/autotest-checkers.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +# + +bash ./build/autoloaderchecker.sh +bash ./build/mergejschecker.sh +php ./build/translation-checker.php +php ./build/htaccess-checker.php + + +for app in $(find "apps/" -mindepth 1 -maxdepth 1 -type d -printf '%f\n'); do + if + [ "$app" == "dav" ] || \ + [ "$app" == "encryption" ] || \ + [ "$app" == "federatedfilesharing" ] || \ + [ "$app" == "files" ] || \ + [ "$app" == "files_external" ] || \ + [ "$app" == "files_sharing" ] || \ + [ "$app" == "files_trashbin" ] || \ + [ "$app" == "files_versions" ] || \ + [ "$app" == "lookup_server_connector" ] || \ + [ "$app" == "provisioning_api" ] || \ + [ "$app" == "testing" ] || \ + [ "$app" == "twofactor_backupcodes" ] || \ + [ "$app" == "updatenotification" ] || \ + [ "$app" == "user_ldap" ] + then + ./occ app:check-code -c strong-comparison "$app" + else + ./occ app:check-code "$app" + fi + RESULT=$? +done; + +php ./build/signed-off-checker.php From 7ec58479f98ef6c8021c079ad701aebecd0fbea7 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 10 May 2017 14:56:16 +0200 Subject: [PATCH 6/8] Fix return code handling Signed-off-by: Joas Schilling --- autotest-checkers.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/autotest-checkers.sh b/autotest-checkers.sh index ff89eba2b5e..295b3729bf1 100755 --- a/autotest-checkers.sh +++ b/autotest-checkers.sh @@ -1,10 +1,15 @@ #!/usr/bin/env bash # +RESULT=0 bash ./build/autoloaderchecker.sh +RESULT=$(($RESULT+$?)) bash ./build/mergejschecker.sh +RESULT=$(($RESULT+$?)) php ./build/translation-checker.php +RESULT=$(($RESULT+$?)) php ./build/htaccess-checker.php +RESULT=$(($RESULT+$?)) for app in $(find "apps/" -mindepth 1 -maxdepth 1 -type d -printf '%f\n'); do @@ -28,7 +33,10 @@ for app in $(find "apps/" -mindepth 1 -maxdepth 1 -type d -printf '%f\n'); do else ./occ app:check-code "$app" fi - RESULT=$? + RESULT=$(($RESULT+$?)) done; php ./build/signed-off-checker.php +RESULT=$(($RESULT+$?)) + +exit $RESULT From f920dfe09b15e101bc4bdf7052afe116c6872742 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 11 May 2017 09:52:55 +0200 Subject: [PATCH 7/8] Skip the code checking for now Signed-off-by: Joas Schilling --- autotest-checkers.sh | 2 +- core/Command/App/CheckCode.php | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/autotest-checkers.sh b/autotest-checkers.sh index 295b3729bf1..d6a45373879 100755 --- a/autotest-checkers.sh +++ b/autotest-checkers.sh @@ -29,7 +29,7 @@ for app in $(find "apps/" -mindepth 1 -maxdepth 1 -type d -printf '%f\n'); do [ "$app" == "updatenotification" ] || \ [ "$app" == "user_ldap" ] then - ./occ app:check-code -c strong-comparison "$app" + ./occ app:check-code --skip-checkers "$app" else ./occ app:check-code "$app" fi diff --git a/core/Command/App/CheckCode.php b/core/Command/App/CheckCode.php index f787529bef9..22a1984b1b3 100644 --- a/core/Command/App/CheckCode.php +++ b/core/Command/App/CheckCode.php @@ -71,6 +71,12 @@ class CheckCode extends Command implements CompletionAwareInterface { 'enable the specified checker(s)', [ 'private', 'deprecation', 'strong-comparison' ] ) + ->addOption( + '--skip-checkers', + null, + InputOption::VALUE_NONE, + 'skips the the code checkers to only check info.xml, language and database schema' + ) ->addOption( '--skip-validate-info', null, From 6dea5e6aadc9611821d6f6c3949af56e9ca298f7 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Tue, 16 May 2017 16:18:02 -0500 Subject: [PATCH 8/8] Implement skip checkers and log the currently tested app Signed-off-by: Morris Jobke --- autotest-checkers.sh | 3 ++- core/Command/App/CheckCode.php | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/autotest-checkers.sh b/autotest-checkers.sh index d6a45373879..35c945a17e9 100755 --- a/autotest-checkers.sh +++ b/autotest-checkers.sh @@ -12,7 +12,8 @@ php ./build/htaccess-checker.php RESULT=$(($RESULT+$?)) -for app in $(find "apps/" -mindepth 1 -maxdepth 1 -type d -printf '%f\n'); do +for app in $(find "apps/" -mindepth 1 -maxdepth 1 -type d -exec basename {} \;); do + echo "Testing $app" if [ "$app" == "dav" ] || \ [ "$app" == "encryption" ] || \ diff --git a/core/Command/App/CheckCode.php b/core/Command/App/CheckCode.php index 22a1984b1b3..46b9b748ada 100644 --- a/core/Command/App/CheckCode.php +++ b/core/Command/App/CheckCode.php @@ -125,7 +125,10 @@ class CheckCode extends Command implements CompletionAwareInterface { $output->writeln(" line $line: {$p['disallowedToken']} - {$p['reason']}"); } }); - $errors = $codeChecker->analyse($appId); + $errors = []; + if(!$input->getOption('skip-checkers')) { + $errors = $codeChecker->analyse($appId); + } if(!$input->getOption('skip-validate-info')) { $infoChecker = new InfoChecker($this->infoParser);