Browse Source

Improve contributing guide and issue template

Julien Falque 7 years ago
parent
commit
5e939f3b89
2 changed files with 56 additions and 39 deletions
  1. 25 7
      .github/ISSUE_TEMPLATE
  2. 31 32
      CONTRIBUTING.md

+ 25 - 7
.github/ISSUE_TEMPLATE

@@ -3,14 +3,32 @@ or visit: https://gitter.im/PHP-CS-Fixer
 
 When reporting an issue (bug) please provide the following information:
 
-The PHP version you are using:
-$ php -v
+#### The PHP version you are using (`$ php -v`):
+=> ....................................
 
-PHP CS Fixer version you are using:
-$ php-cs-fixer -V
+#### PHP CS Fixer version you are using (`$ php-cs-fixer -V`):
+=> ....................................
 
-The command you use to run the fixer (and the configuration file you are using if any).
+#### The command you use to run PHP CS Fixer:
+=> ....................................
 
-A minimal sample of valid PHP code that is not fixed correctly (if applicable).
+#### The configuration file you are using, if any:
+```php
+=> ....................................
+```
 
-The fixed version of that code after you run the fixer and the version you expected.
+#### If applicable, please provide minimum samples of PHP code (as plain text, not screenshots):
+ * before running PHP CS Fixer (no changes):
+```php
+=> ....................................
+```
+
+ * with unexpected changes applied when running PHP CS Fixer:
+```php
+=> ....................................
+```
+
+ * with the changes you expected instead:
+```php
+=> ....................................
+```

+ 31 - 32
CONTRIBUTING.md

@@ -1,42 +1,41 @@
-# Contributions are welcome!
+# Contributions Are Welcome!
 
-## Quick guide
+If you need any help, don't hesitate to ask the community on [Gitter](https://gitter.im/PHP-CS-Fixer/Lobby).
 
- * Fork the repo.
- * Checkout the branch you want to make changes on:
-  * Master if you make changes to the code that are not backward compatible.
-  * Default branch when adding new features.
-  * Branch before the default if you are fixing a bug for an existing feature (or the default/master branch if the feature was introduced in that version).
- * Install dependencies: `composer install`.
- * Create branch, e.g. `feature-foo` or `bugfix-bar`.
- * Make changes.
- * If you are adding functionality or fixing a bug - add a test!
- * Fix project itself: `php php-cs-fixer fix`.
- * Make sure there is no trailing spaces in code: `./check_trailing_spaces.sh`.
- * Regenerate readme: `php php-cs-fixer readme > README.rst`. Do not modify `README.rst` manually!
- * Check if tests pass: `phpunit` [(4.x or 5.x)](https://phpunit.de/manual/current/en/installation.html)
+## Quick Guide
 
-## Opening a pull request
+* [Fork](https://help.github.com/articles/fork-a-repo/) the repo.
+* [Checkout](https://git-scm.com/docs/git-checkout) the branch you want to make changes on:
+  * If you are fixing a bug or typo, improving tests or for any small tweak: the lowest maintained branch where the changes can be applied. Once your Pull Request is accepted, the changes will get merged up to highest branches.
+  * `master` in other cases (new feature, deprecation, or backwards compatibility breaking changes). Note that most of the time, `master` represents the next minor release of PHP CS Fixer, so Pull Requests that break backwards compatibility might be postponed.
+* Install dependencies: `composer install`.
+* Create a new branch, e.g. `feature-foo` or `bugfix-bar`.
+* Make changes.
+* If you are adding functionality or fixing a bug - add a test! Prefer adding new test cases over modifying existing ones.
+* Make sure there is no trailing spaces in code: `./check_trailing_spaces.sh`.
+* Regenerate README: `php php-cs-fixer readme > README.rst`. Do not modify `README.rst` manually!
+* Check if tests pass: `vendor/bin/phpunit`.
+* Fix project itself: `php php-cs-fixer fix`.
 
-You can do some things to increase the chance that your pull request is accepted the first time:
+## Opening a [Pull Request](https://help.github.com/articles/about-pull-requests/)
 
- * Submit one pull request per fix or feature.
- * If your changes are not up to date - rebase your branch on the parent branch.
- * Follow the conventions used in the project.
- * Remember about tests and documentation.
- * Don't bump version.
+You can do some things to increase the chance that your Pull Request is accepted the first time:
 
-## Making new fixers
+* Submit one Pull Request per fix or feature.
+* If your changes are not up to date, [rebase](https://git-scm.com/docs/git-rebase) your branch onto the parent branch.
+* Follow the conventions used in the project.
+* Remember about tests and documentation.
+* Don't bump version.
 
-There is a [cookbook](https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/master/doc/COOKBOOK-FIXERS.md) with basic instructions on how to build a new fixer. Consider reading it
+## Making New Fixers
+
+There is a [cookbook](doc/COOKBOOK-FIXERS.md) with basic instructions on how to build a new fixer. Consider reading it
 before opening a PR.
 
-## Project's standards
+## Project's Standards
 
- * [PSR-1: Basic Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md)
- * [PSR-2: Coding Style Guide](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)
- * [PSR-4: Autoloading Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md)
- * [PSR-5: PHPDoc (draft)](https://github.com/phpDocumentor/fig-standards/blob/master/proposed/phpdoc.md)
- * [Symfony Coding Standards](http://symfony.com/doc/current/contributing/code/standards.html)
- * [Symfony Documentation Standards](http://symfony.com/doc/current/contributing/documentation/standards.html)
- * Keep the order of class elements: static properties, instance properties, constructor (or setUp for PHPUnit), destructor (or tearDown for PHPUnit), static methods, instance methods, magic static methods, magic instance methods.
+* [PSR-1: Basic Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md)
+* [PSR-2: Coding Style Guide](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)
+* [PSR-4: Autoloading Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md)
+* [PSR-5: PHPDoc (draft)](https://github.com/phpDocumentor/fig-standards/blob/master/proposed/phpdoc.md)
+* [Symfony Coding Standards](https://symfony.com/doc/current/contributing/code/standards.html)