Clarify some bits of CONTRIBUTING.md and unify formatting

This commit is contained in:
spawnia 2019-03-28 11:24:06 +01:00
parent b088720d40
commit 569945cd37

View File

@ -1,7 +1,6 @@
# Contributing to GraphQL PHP # Contributing to GraphQL PHP
## Workflow ## Workflow
If your contribution requires significant or breaking changes, or if you plan to propose a major new feature, If your contribution requires significant or breaking changes, or if you plan to propose a major new feature,
we recommend you to create an issue on the [GitHub](https://github.com/webonyx/graphql-php/issues) with we recommend you to create an issue on the [GitHub](https://github.com/webonyx/graphql-php/issues) with
a brief proposal and discuss it with us first. a brief proposal and discuss it with us first.
@ -14,9 +13,10 @@ For smaller contributions just use this workflow:
* Check your changes using `composer check-all` * Check your changes using `composer check-all`
* Send a pull request * Send a pull request
## Using GraphQL PHP from a Git checkout ## Setup the Development Environment
First, copy the URL of your fork and `git clone` it to your local machine.
```sh ```sh
git clone https://github.com/webonyx/graphql-php.git
cd graphql-php cd graphql-php
composer install composer install
``` ```
@ -29,28 +29,26 @@ composer install
Some tests have annotation `@see it('<description>')`. It is used for reference to same tests in [graphql-js implementation](https://github.com/graphql/graphql-js) with the same description. Some tests have annotation `@see it('<description>')`. It is used for reference to same tests in [graphql-js implementation](https://github.com/graphql/graphql-js) with the same description.
## Coding Standard ## Coding Standard
Coding standard of this project is based on [Doctrine CS](https://github.com/doctrine/coding-standard). To run the inspection: The coding standard of this project is based on [Doctrine CS](https://github.com/doctrine/coding-standard).
Run the inspections:
```sh ```sh
./vendor/bin/phpcs ./vendor/bin/phpcs
``` ```
Auto-fixing: Apply automatic code style fixes:
```sh ```sh
./vendor/bin/phpcbf ./vendor/bin/phpcbf
``` ```
## Static analysis ## Static analysis
Based on [PHPStan](https://github.com/phpstan/phpstan) Based on [PHPStan](https://github.com/phpstan/phpstan).
```sh ```sh
./vendor/bin/phpstan analyse --ansi --memory-limit 256M ./vendor/bin/phpstan analyse --ansi --memory-limit 256M
``` ```
## Running benchmarks ## Running benchmarks
Benchmarks are run via [PHPBench](https://github.com/phpbench/phpbench).
Benchmarks are run via phpbench:
```sh ```sh
./vendor/bin/phpbench run . ./vendor/bin/phpbench run .
``` ```