|
2 | 2 |
|
3 | 3 | If you would like to contribute, here are some notes and guidelines:
|
4 | 4 |
|
5 |
| - - All new development happens on feature/fix branches, and are then merged to the `master` branch once stable; so the `master` branch is always the most up-to-date, working code |
6 |
| - - Tagged releases are made from the `master` branch |
7 |
| - - If you are going to be submitting a pull request, please fork from `master`, and submit your pull request back as a fix/feature branch referencing the GitHub issue number |
8 |
| - - Code style might be automatically fixed by `composer fix` |
9 |
| - - All code changes must be validated by `composer check` |
| 5 | + - All new development should be on feature/fix branches, which are then merged to the `master` branch once stable and approved; so the `master` branch is always the most up-to-date, working code |
| 6 | + - If you are going to submit a pull request, please fork from `master`, and submit your pull request back as a fix/feature branch referencing the GitHub issue number |
| 7 | + - The code must work with all PHP versions that we support (currently PHP 7.4 to PHP 8.2). |
| 8 | + - You can call `composer versions` to test version compatibility. |
| 9 | + - Code style should be maintained. |
| 10 | + - `composer style` will identify any issues with Coding Style`. |
| 11 | + - `composer fix` will fix most issues with Coding Style. |
| 12 | + - All code changes must be validated by `composer check`. |
| 13 | + - Please include Unit Tests to verify that a bug exists, and that this PR fixes it. |
| 14 | + - Please include Unit Tests to show that a new Feature works as expected. |
| 15 | + - Please don't "bundle" several changes into a single PR; submit a PR for each discrete change/fix. |
| 16 | + |
10 | 17 | - [Helpful article about forking](https://help.github.com/articles/fork-a-repo/ "Forking a GitHub repository")
|
11 | 18 | - [Helpful article about pull requests](https://help.github.com/articles/using-pull-requests/ "Pull Requests")
|
12 | 19 |
|
| 20 | +## Unit Tests |
| 21 | + |
| 22 | +When writing Unit Tests, please |
| 23 | + - Always try to write Unit Tests for both the happy and unhappy paths. |
| 24 | + - Put all assertions in the Test itself, not in an abstract class that the Test extends (even if this means code duplication between tests). |
| 25 | + - Include any necessary `setup()` and `tearDown()` in the Test itself. |
| 26 | + - If you change any global settings (such as system locale, or Compatibility Mode for Excel Function tests), make sure that you reset to the default in the `tearDown()`. |
| 27 | + |
| 28 | +This makes it easier to see exactly what is being tested when reviewing the PR. I want to be able to see it in the PR, not have to hunt in other classes to see what the test is doing. |
| 29 | + |
13 | 30 | ## How to release
|
14 | 31 |
|
15 | 32 | 1. Complete CHANGELOG.md and commit
|
16 | 33 | 2. Create an annotated tag
|
17 | 34 | 1. `git tag -a 1.2.3`
|
18 | 35 | 2. Tag subject must be the version number, eg: `1.2.3`
|
19 |
| - 3. Tag body must be a copy-paste of the changelog entries |
20 |
| -3. Push tag with `git push --tags`, GitHub Actions will create a GitHub release automatically |
| 36 | + 3. Tag body must be a copy-paste of the changelog entries. |
| 37 | +3. Push the tag with `git push --tags`, GitHub Actions will create a GitHub release automatically, and the release details will automatically be sent to packagist. |
| 38 | +4. Github seems to remove markdown headings in the Release Notes, so you should edit to restore these. |
| 39 | + |
| 40 | +> **Note:** Tagged releases are made from the `master` branch. Only in an emergency should a tagged release be made from the `release` branch. (i.e. cherry-picked hot-fixes.) |
| 41 | +
|
0 commit comments