Moodle Plugins directory: Code-checker | Moodle.org
Code-checker
General plugins (Local) ::: local_codechecker
Maintained by Eloy Lafuente (stronk7), Tim Hunt, Víctor Déniz Falcón, Sara Arjona Téllez
Part of set Moodle development.
A tool for developers that helps them follow Moodle's coding style.
Latest release:
752 sites
633 downloads
63 fans
Current versions available: 8
This Moodle plugin uses the PHP CodeSniffer tool to check that code follows the Moodle coding style. It implements and reuses a set of 'sniffs' that check many aspects of the code, including the awesome PHPCompatibility ones.
They also present a nice web interface for viewing the results.
Contributors
Eloy Lafuente (stronk7) (Lead maintainer)
Tim Hunt
Víctor Déniz Falcón
Sara Arjona Téllez
Please login to view contributors details and/or to contact them
I don't recommend to ignore warnings. In fact, I do recommend to check both errors and warnings. More yet, I do check both always.
I only say that, while errors are clear violations, warnings can be understood as recommendations. If you decide to follow or ignore them it's up to you. Personally I follow them, it's not so hard, really. But your choice, anyway.
Ciao
Looking at the code I believe that this: https://github.com/moodlehq/moodle-local_codechecker/blob/master/moodle/tests/moodlestandard_test.php#L344 should be a failure of 'Expected 1 space before "="; 2 found' given: https://github.com/moodlehq/moodle-local_codechecker/blob/master/moodle/tests/fixtures/squiz_whitespace_operatorspacing.php#L18
Cheers,
Gareth
This doesn't check the column names in install.xml file. There is a coding standard for the column names as well. "Column names should be always lowercase, simple and short, following the same rules as for variable names. (https://docs.moodle.org/dev/Database)".
What are the thoughts of having the code checker ignore code folding? Does code folding need to be defined in the Moodle coding style before being allowed in the code checker?
/// <editor-fold desc="This is a bunch of code that does stuff">
/// </editor-fold>
I don't know which editor you are using for that syntax to work. I have never seen it before, but doing something just for one editor is less likely to be a sensible decision.
So, given we want to encourage well-factored code, not long sprawling blocks of code, and we want to be editor-neutral, I am not enthusiastic about your suggestion.
Release 2.9.2 - Selectivenesses"
I did forget to bump version.php and just discovered it when publishing the new version in the Plugins directory. Expect a new release soon (2.9.3) fixing that. Sorry for the troubles!