From 9e1b234324926d8a54ca58e75e3c64132540aa58 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 18 Mar 2017 10:33:49 -0500 Subject: [PATCH] Add Composer scripts as shortcuts to tests and doc generation --- CONTRIBUTING.md | 4 +--- README.md | 2 +- composer.json | 11 +++++++++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 65ee5a5..52b0792 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -56,9 +56,7 @@ When you do begin working on your feature, here are some guidelines to consider: The following tests must pass before we will accept a pull request. If any of these do not pass, it will result in a complete build failure. Before you can run these, be sure to `composer install`. ``` -./vendor/bin/parallel-lint src tests -./vendor/bin/phpcs src tests --standard=psr2 -sp -./vendor/bin/phpunit --verbose +composer test ``` ### Locally Test With Emulated MIPS Architecture diff --git a/README.md b/README.md index afb9636..b6557ab 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ The [latest class API documentation][apidocs] is available online. This project uses [ApiGen](http://apigen.org/) to generate this documentation. To generate the documentation on your own, install dev dependencies and run the following command from the root of the project: ``` -./vendor/bin/apigen generate --source="src" --destination="build/apidocs" --title="ramsey/uuid" --template-theme="bootstrap" --deprecated --todo +composer build-docs ``` This will generate documentation in the `build/apidocs/` folder. diff --git a/composer.json b/composer.json index 9936794..23b686d 100644 --- a/composer.json +++ b/composer.json @@ -63,5 +63,16 @@ "branch-alias": { "dev-master": "3.x-dev" } + }, + "scripts": { + "lint": "parallel-lint src tests", + "phpunit": "phpunit --verbose --colors=always", + "phpcs": "phpcs src tests --standard=psr2 -sp --colors", + "test": [ + "@lint", + "@phpunit", + "@phpcs" + ], + "build-docs": "apigen generate --source='src' --destination='build/apidocs' --template-theme='bootstrap' --deprecated --todo" } }