Last modified: 2013-01-22 14:36:31 UTC
This bug is about analyzing PHP file coding style. This might just be a weekly job or run on every change. As a first step, we could use our homegrown style checker We already have trunk/tools/code-utils/check-vars.php It will does the job. On a long term we want to migrate to PHP CodeSniffer which comes with a nice reporting and a nice interface to build syntax check upon. Jenkins already has a plugin to interface with CodeSniffer making integration of PHP style check easier. A basic MediaWiki syntax is available at https://github.com/hashar/PHP_CodeSniffer
Removing as blocker for the initial CI plan implementation
The relevant project is mediawiki/tools/codesniffer.git Gitweb: https://gerrit.wikimedia.org/gitweb/mediawiki/tools/codesniffer.git Gerrit changes: https://gerrit.wikimedia.org/r/#q,project%3Amediawiki/tools/codesniffer,n,z
ccing Platonides who talked about CodeSniffer with me a few days ago
I finally looked at this during some spare time. The related changes are: Jenkins: "PHP CodeSniffer macros and templates" https://gerrit.wikimedia.org/r/45063 "Jobs for mediawiki/core" https://gerrit.wikimedia.org/r/45064 Zuul: "phpcs jobs are non voting for now" https://gerrit.wikimedia.org/r/45065 "triggers the PHP cs jobs above" https://gerrit.wikimedia.org/r/45066
Will eventually test out / deploy that tomorrow (or another day)
deployed in production for mediawiki/core.git
Example output for the maintenance/eval.php file: https://integration.mediawiki.org/ci/job/mediawiki-core-phpcs-HEAD/3/violations/file/maintenance/eval.php/?
I have updated the MediaWiki coding standard https://gerrit.wikimedia.org/r/#/c/45131/ Wrote some lame documentation on the wiki https://www.mediawiki.org/wiki/Continuous_integration/PHP_CodeSniffer And changed our Jenkins jobs to use that standard https://gerrit.wikimedia.org/r/#/c/45134/ So this is now implemented. If there is anything wrong, we will fill new bugs :)