moodlehq / moodle-plugin-ci

Helps running Moodle plugins analysis checks and tests under various CI environments.
https://moodlehq.github.io/moodle-plugin-ci/
GNU General Public License v3.0
41 stars 43 forks source link

Define the coding style (PHP_CodeSniffer) for the product #285

Closed stronk7 closed 3 months ago

stronk7 commented 4 months ago

I've been using locally a phpcs.xml.dist file since ages ago. That way, apart from php-cs-fixer that we also use, we can have, within the IDEs everything checker with PHP_CodeSniffer.

Recently, we applied that also to moodle-cs, so you can see the file proposal here:

https://github.com/moodlehq/moodle-cs/blob/main/phpcs.xml.dist

Basically, it's PSR12 with a few exceptions, not controversial, and some extra rules about short arrays and other details.

Currently we are already compliant about that, so no many changes are expected apart from adding the phpcs.xml.dist itself.