moodlehq / moodle-local_codechecker

A Moodle local plugin providing a simple web UI to run the MoodleCS coding style checks with PHP_CodeSniffer.
63 stars 72 forks source link

Add coverage info (and related Sniff) #143

Closed stronk7 closed 3 years ago

stronk7 commented 3 years ago

This includes 2 commits:

  1. 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).

  2. 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:

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!
stronk7 commented 3 years ago

Thanks!