Add the coverage.php file for the plugin, so when running with coverage enabled we get info about the files we are interested (keeping apart things like PHPCompatibilty, PHP_CodeSniffer... that are not ours).
Add a new sniff that supports the "return new class extends..." anonymous classes.
Important note: This will be failing a number of the checks, because moodle-plugin-ci ( that is in charge of checking this) still doesn't know about the new moodlecheck and codechecker improvements, namely:
codechecker: Will fail with error in this patch line 19, because it's not aware of the new "return new class extends..." sniff that will allow those phpdoc blocks to exist.
moodlecheck: Will fail because it's not aware that now we can skip the file phpdoc block when the file is an 1-artifact one (that was recently added to moodlecheck, but it's not yet on moodle-plugin-ci).
That's pretty much the reason we want to release a new moodle-plugin-ci version this week, to get all those improvements incorporated.
But if you run codechecker and moodlecheck locally (or via CiBoT)... they all pass:
$ phpcs/bin/phpcs --standard=moodle tests/coverage.php && echo "all ok!"
all ok!
$ php local/moodlecheck/cli/moodlecheck.php -p local/codechecker/tests/coverage.php && echo "all ok!"
all ok!
This includes 2 commits:
Add the
coverage.php
file for the plugin, so when running with coverage enabled we get info about the files we are interested (keeping apart things like PHPCompatibilty, PHP_CodeSniffer... that are not ours).Add a new sniff that supports the "return new class extends..." anonymous classes.
Important note: This will be failing a number of the checks, because
moodle-plugin-ci
( that is in charge of checking this) still doesn't know about the newmoodlecheck
andcodechecker
improvements, namely:That's pretty much the reason we want to release a new
moodle-plugin-ci
version this week, to get all those improvements incorporated.But if you run codechecker and moodlecheck locally (or via CiBoT)... they all pass: