Right now our testrun job doesn't use MediaWiki core's phpcs.xml file, so there's a lot of noise from $IP, $messageMemc, etc (at least I find it annoying). We should refactor the job so it produces identical output as running that version against core (i.e. use the phpcs.xml file).
Description
Details
Event Timeline
I'm thinking...
- zuul-cloner to fetch mw/tools/codesniffer and mw/core
- cd mw/core
- composer update
- mv mw/tools/codesniffer -> mw/core/vendor/mediawiki/mediawiki-codesniffer
- composer dump-autoload
- mw/core/vendor/bin/phpcs -s -p
That doesn't handle cases where we change the phpcs version requirement.
Is this the version requirement in the composer.json of mw/core? If so, why do we need to account for that?
Also, it would be nice if I could see the *diff* in the phpcs output after applying the new commit.
From https://github.com/squizlabs/PHP_CodeSniffer/releases/tag/2.5.0:
- PHPCS will now use a phpcs.xml file even if files are specified on the command line
- This file is still only used if no standard is specified on the command line
Change 303802 had a related patch set uploaded (by Paladox):
Update MW codesniffer test core test to use mediawiki phpcs file
Change 434816 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[integration/config@master] Use mediawiki-phpcs-dryrun image
Change 434816 merged by jenkins-bot:
[integration/config@master] Use mediawiki-phpcs-dryrun image
FYI @Umherirrender and @thiemowmde
The way this job now works (simplified) is that it clones master of mediawiki/core, runs composer install --prefer-source, then checks out the new commit of codesniffer in vendor/mediawiki/mediawiki-codesniffer, and then runs phpcs.
This means that if a dependency changes, that won't be reflected, and any sniffs disabled in core's phpcs.xml won't be run either. If either of those changes interfere with your workflow, let me know and I can re-open this and adjust as necessary.
Oh, https://integration.wikimedia.org/ci/job/mw-tools-codesniffer-mwcore-testrun/752/console is an example of the new job being used.
Change 303802 abandoned by Legoktm:
Update MW codesniffer test core test to use mediawiki phpcs file
Reason:
Unnecessary now.