|
| 1 | +# Contributing |
| 2 | + |
| 3 | +Contributions are welcome. We accept pull requests on [GitHub](https://github.com/phpcfdi/rfc). |
| 4 | + |
| 5 | +This project adheres to a |
| 6 | +[Contributor Code of Conduct](https://github.com/phpcfdi/rfc/blob/master/CODE_OF_CONDUCT.md). |
| 7 | +By participating in this project and its community, you are expected to uphold this code. |
| 8 | + |
| 9 | +## Team members |
| 10 | + |
| 11 | +* [Carlos C Soto](https://github.com/eclipxe13) - original author and maintainer |
| 12 | +* [GitHub constributors](https://github.com/phpcfdi/rfc/graphs/contributors) |
| 13 | + |
| 14 | +## Communication Channels |
| 15 | + |
| 16 | +You can find help and discussion in the following places: |
| 17 | + |
| 18 | +* GitHub Issues: <https://github.com/phpcfdi/rfc/issues> |
| 19 | + |
| 20 | +## Reporting Bugs |
| 21 | + |
| 22 | +Bugs are tracked in our project's [issue tracker](https://github.com/phpcfdi/rfc/issues). |
| 23 | + |
| 24 | +When submitting a bug report, please include enough information for us to reproduce the bug. |
| 25 | +A good bug report includes the following sections: |
| 26 | + |
| 27 | +* Expected outcome |
| 28 | +* Actual outcome |
| 29 | +* Steps to reproduce, including sample code |
| 30 | +* Any other information that will help us debug and reproduce the issue, including stack traces, system/environment information, and screenshots |
| 31 | + |
| 32 | +**Please do not include passwords or any personally identifiable information in your bug report and sample code.** |
| 33 | + |
| 34 | +## Fixing Bugs |
| 35 | + |
| 36 | +We welcome pull requests to fix bugs! |
| 37 | + |
| 38 | +If you see a bug report that you'd like to fix, please feel free to do so. |
| 39 | +Following the directions and guidelines described in the "Adding New Features" |
| 40 | +section below, you may create bugfix branches and send us pull requests. |
| 41 | + |
| 42 | +## Adding New Features |
| 43 | + |
| 44 | +If you have an idea for a new feature, it's a good idea to check out our |
| 45 | +[issues](https://github.com/phpcfdi/rfc/issues) or active |
| 46 | +[pull requests](https://github.com/phpcfdi/rfc/pulls) |
| 47 | +first to see if the feature is already being worked on. |
| 48 | +If not, feel free to submit an issue first, asking whether the feature is beneficial to the project. |
| 49 | +This will save you from doing a lot of development work only to have your feature rejected. |
| 50 | +We don't enjoy rejecting your hard work, but some features just don't fit with the goals of the project. |
| 51 | + |
| 52 | +When you do begin working on your feature, here are some guidelines to consider: |
| 53 | + |
| 54 | +* Your pull request description should clearly detail the changes you have made. |
| 55 | +* Follow our code style using `squizlabs/php_codesniffer` and `friendsofphp/php-cs-fixer`. |
| 56 | +* Please **write tests** for any new features you add. |
| 57 | +* Please **ensure that tests pass** before submitting your pull request. We have Travis CI automatically running tests for pull requests. However, running the tests locally will help save time. |
| 58 | +* **Use topic/feature branches.** Please do not ask us to pull from your master branch. |
| 59 | +* **Submit one feature per pull request.** If you have multiple features you wish to submit, please break them up into separate pull requests. |
| 60 | +* **Send coherent history**. Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before submitting. |
| 61 | + |
| 62 | +## Installing development tools |
| 63 | + |
| 64 | +This project uses different development tools to ensure code style, test and quality (using code analyzers). |
| 65 | + |
| 66 | +```shell |
| 67 | +# install project direct dependences |
| 68 | +composer install |
| 69 | + |
| 70 | +# install development tools dependences (using composer script) |
| 71 | +composer dev:install |
| 72 | + |
| 73 | +# install development tools dependences (using installer script) |
| 74 | +bash develop/install-development-tools |
| 75 | +``` |
| 76 | + |
| 77 | +## Check the code style |
| 78 | + |
| 79 | +If you are having issues with coding standars use `php-cs-fixer` and `phpcbf` |
| 80 | + |
| 81 | +```shell |
| 82 | +# using composer |
| 83 | +composer dev:fix-style |
| 84 | + |
| 85 | +# or using tools individually |
| 86 | +tools/php-cs-fixer fix -v |
| 87 | +tools/phpcbf -sp src/ tests/ |
| 88 | +``` |
| 89 | + |
| 90 | +## Running Tests |
| 91 | + |
| 92 | +The following tests must pass before we will accept a pull request. |
| 93 | +If any of these do not pass, it will result in a complete build failure. |
| 94 | +Before you can run these, be sure to `composer install` or `composer update`. |
| 95 | + |
| 96 | +```shell |
| 97 | +# using composer |
| 98 | +composer dev:build |
| 99 | + |
| 100 | +# or using tools individually |
| 101 | +tools/phpcs -sp src/ tests/ |
| 102 | +tools/php-cs-fixer fix -v --dry-run |
| 103 | +vendor/bin/phpunit --coverage-text |
| 104 | +tools/phpstan analyze --level max src/ tests/ |
| 105 | +tools/psalm |
| 106 | +phpdbg -qrr tools/infection --show-mutations |
| 107 | +``` |
0 commit comments