diff --git a/src/Command/CodeCheckerCommand.php b/src/Command/CodeCheckerCommand.php index bc153c62..b3dd72e1 100644 --- a/src/Command/CodeCheckerCommand.php +++ b/src/Command/CodeCheckerCommand.php @@ -79,6 +79,15 @@ protected function execute(InputInterface $input, OutputInterface $output): int // @codeCoverageIgnoreEnd $exclude = $input->getOption('exclude'); + + // There are some differences in the checks performed when the code to + // check is a plugin or a Moodle core directory. And, here, we are always + // checking a plugin, so we need to exclude some checks that are not + // applicable. + // TODO: If https://github.com/moodlehq/moodle-cs/issues/92 becomes implemented, then + // we'll just have to change to the new, plugins specific, standard and forget. + $exclude .= (!empty($exclude) ? ',' : '') . 'moodle.Commenting.TodoComment'; + $cmd = array_merge($basicCMD, [ '--standard=' . ($input->getOption('standard') ?: 'moodle'), '--extensions=php', diff --git a/tests/Fixture/moodle-local_ci/lib.php b/tests/Fixture/moodle-local_ci/lib.php index 5312d695..ae928c1c 100644 --- a/tests/Fixture/moodle-local_ci/lib.php +++ b/tests/Fixture/moodle-local_ci/lib.php @@ -22,6 +22,9 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ +// TODO: This todo comment without any MDL link is good for moodle-plugin-ci +// (because we disable the moodle.Commenting.TodoComment sniff for plugins). + /** * Add *