From c451c9a2687268663eb97d93d1614178d8e914bf Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh <77877486+everly-gif@users.noreply.github.com> Date: Wed, 1 Jun 2022 20:52:35 +0530 Subject: [PATCH] Update CONTRIBUTING.md --- CONTRIBUTING.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1a5ceb891..aa7152a64 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,20 +44,20 @@ $ git checkout -b [name_of_your_new_branch] 3. Work - commit - repeat ( be sure to be in your branch ) 4. Before you push your changes, make sure your code follows the `PSR12` coding standards , which is the standard Appwrite follows currently. - You can easily do this by running the formatter + You can easily do this by running the formatter. ```bash -./vendor/bin/phpcbf --standard=PSR12 +./vendor/bin/phpcbf ``` This will format the code according to the `PSR12` coding standard. -Now, go a step further by running the linter by the following command to manually fix the issues the formatter wasn't able to fix +Now, go a step further by running the linter by the following command to manually fix the issues the formatter wasn't able to fix. ```bash -./vendor/bin/phpcs --standard=PSR12 +./vendor/bin/phpcs ``` -This will give you a list of errors for you to rectify , if there is an instance you need more information on the errors being displayed you can pass in additional command line arguments. More list of available arguments can be found [here](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage). A very useful command line argument is `--report=diff`. This will give you the expected changes by the linter for easy fixing of formatting issues +This will give you a list of errors for you to rectify , if there is an instance you need more information on the errors being displayed you can pass in additional command line arguments. More list of available arguments can be found [here](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage). A very useful command line argument is `--report=diff`. This will give you the expected changes by the linter for easy fixing of formatting issues. ```bash -./vendor/bin/phpcs --standard=PSR12 --report=diff +./vendor/bin/phpcs --report=diff ``` 5. Push changes to GitHub @@ -240,7 +240,7 @@ Appwrite uses [PHP's Composer](https://getcomposer.org/) for managing dependenci ## Coding Standards -Appwrite is following the [PHP-FIG standards](https://www.php-fig.org/). Currently, we are using _PSR-12_ for coding standards and autoloading standards. +Appwrite is following the [PHP-FIG standards](https://www.php-fig.org/). Currently, we are using PSR-0 and PSR-12 for coding standards and autoloading standards. We use prettier for our JS coding standards and auto-formatting our code. @@ -397,10 +397,14 @@ We use some automation tools to help us keep a healthy codebase. Coding Standards: +`Run Formatter` : + ```bash ./vendor/bin/phpcbf --standard=PSR12 ``` +`Run Linter` : + ```bash ./vendor/bin/phpcs --standard=PSR12 ```