Legoktm has submitted this change and it was merged.

Change subject: Add composer lint, phpcs, and test commands
......................................................................


Add composer lint, phpcs, and test commands

lint uses jakub-onderka/php-parallel-lint to check the syntax of the provided
PHP files or directories.

phpcs uses the MediaWiki codesniffer standard to check the provided files or
directories.

test runs both lint and phpcs together. phpunit is not included at this time
because our phpunit tests require a database to be set up and are very very
slow.

Example usage:
  composer lint .  # Lint all files
  composer phpcs includes/FooBar.php  # Check code style of one file
  composer test extensions/FooBar  # Lint and check an extension

Change-Id: I3c7ac7a02668776de6400ac268f37e7e6b35a3c6
---
M composer.json
1 file changed, 9 insertions(+), 1 deletion(-)

Approvals:
  BryanDavis: Looks good to me, approved
  Hashar: Looks good to me, but someone else must approve
  Jforrester: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/composer.json b/composer.json
index a289446..11520ef 100644
--- a/composer.json
+++ b/composer.json
@@ -27,8 +27,10 @@
                "zordius/lightncandy": "0.18"
        },
        "require-dev": {
+               "jakub-onderka/php-parallel-lint": "~0.8",
                "justinrainbow/json-schema": "~1.3",
-               "phpunit/phpunit": "~4.5"
+               "phpunit/phpunit": "~4.5",
+               "mediawiki/mediawiki-codesniffer": "0.1.0"
        },
        "suggest": {
                "ext-fileinfo": "*",
@@ -44,6 +46,12 @@
                }
        },
        "scripts": {
+               "lint": "parallel-lint --exclude vendor",
+               "phpcs": "phpcs $PHPCS_ARGS -s 
--standard=vendor/mediawiki/mediawiki-codesniffer/MediaWiki --ignore=vendor 
--encoding=utf-8 --extensions=php,php5,inc,sample",
+               "test": [
+                       "composer lint",
+                       "composer phpcs"
+               ],
                "pre-update-cmd": "ComposerHookHandler::onPreUpdate",
                "pre-install-cmd": "ComposerHookHandler::onPreInstall"
        },

-- 
To view, visit https://gerrit.wikimedia.org/r/183067
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3c7ac7a02668776de6400ac268f37e7e6b35a3c6
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: BryanDavis <[email protected]>
Gerrit-Reviewer: Daniel Friesen <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to