From 2eac822ee834d8b35164f9cfdba72ef4e2995536 Mon Sep 17 00:00:00 2001 From: Colin Viebrock Date: Thu, 28 Nov 2024 20:36:17 -0600 Subject: [PATCH] Update pull request template and CONTRIBUTING.md with new requirements --- .github/PULL_REQUEST_TEMPLATE.md | 4 +++- CONTRIBUTING.md | 21 +++++++++++++++------ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 12f2e2b..5ee8771 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -4,8 +4,10 @@ Please make sure you've read [CONTRIBUTING.md](https://github.com/cviebrock/eloq before submitting your pull request, and that you have: - [ ] provided a rationale for your change (I try not to add features that are going to have a limited user-base) -- [ ] used the [PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) +- [ ] checked your coding style with `composer run style:check` +- [ ] analyzed your code with `composer run analyze` - [ ] added tests +- [ ] confirm all old and new tests pass with `composer run tests` - [ ] documented any change in behaviour (e.g. updated the `README.md`, etc.) - [ ] only submitted one pull request per feature diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2fdd1a7..f82e180 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,18 +7,27 @@ We accept contributions via pull requests via 1. Fork the project. 2. Create your bugfix/feature branch and write your (well-commented) code. -3. Create unit tests for your code: +3. Ensure you follow our coding style: + - Run `composer run style:check` to check. + - Run `composer run style:fix` to automagically fix styling errors. +4. Run basic static analysis on your code with `composer run analyze` and fix any errors. +5. Create unit tests for your code: - Run `composer install --dev` in the root directory to install required testing packages. - Add your test classes/methods to the `/tests/` directory. - - Run `vendor/bin/phpunit` and make sure everything passes (new and old tests). -3. Commit your changes (and your tests) and push to your branch. -4. Create a new pull request against this package's `master` branch. + - Run `composer run tests` and make sure everything passes (new and old tests). +6. Updated any documentation (e.g. in `README.md`), if appropriate. +7. Commit your changes (and your tests) and push to your branch. +8. Create a new pull request against this package's `master` branch. ## Pull Requests -- **Use the [PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md).** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer). +- **Use the [PHP-CS-Fixer Coding Standard](https://cs.symfony.com/doc/ruleSets/PhpCsFixer.html).** + The easiest way to apply the conventions is to run `composer run style:fix`. + +- **Run static analysis with [phpstan](https://phpstan.org).** + The easiest way to check is with `composer run analyze`. Bonus points if you can bump up the + analysis level in `phpstan.dist.neon`! - **Add tests!** Your pull request won't be accepted if it doesn't have tests.