From 89fa0c3e67f55c9a90eef981c2822f006a0b9ce9 Mon Sep 17 00:00:00 2001 From: Vladimir Razuvaev Date: Thu, 22 Nov 2018 19:57:53 +0700 Subject: [PATCH] More composer scripts + related changes to CONTRIBUTING.md --- CONTRIBUTING.md | 15 ++++++++++++++- composer.json | 7 ++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6996683..8c12d16 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,6 +11,7 @@ For smaller contributions just use this workflow: * Fork the project. * Add your features and or bug fixes. * Add tests. Tests are important for us. +* Check your changes using `composer check-all` * Send a pull request ## Using GraphQL PHP from a Git checkout @@ -34,10 +35,22 @@ Coding standard of this project is based on [Doctrine CS](https://github.com/doc ./vendor/bin/phpcs ``` +Auto-fixing: +```sh +./vendor/bin/phpcbf +``` + +## Static analysis +Based on [PHPStan](https://github.com/phpstan/phpstan) +```sh +./vendor/bin/phpstan analyse --ansi --memory-limit 256M +``` + + ## Running benchmarks Benchmarks are run via phpbench: ```sh -./vendor/bin/phpbench run +./vendor/bin/phpbench run . ``` diff --git a/composer.json b/composer.json index c6e6abd..188e435 100644 --- a/composer.json +++ b/composer.json @@ -44,7 +44,12 @@ "psr/http-message": "To use standard GraphQL server" }, "scripts": { + "api-docs": "php tools/gendocs.php", + "bench": "phpbench run .", + "test": "phpunit", "lint" : "phpcs", - "static-analysis": "phpstan analyse --ansi" + "fix-style" : "phpcbf", + "static-analysis": "phpstan analyse --ansi --memory-limit 256M", + "check-all": "composer lint && composer static-analysis && composer test" } }