Skip to content

Commit bb04d57

Browse files
authored
Better contributing documentation (#2707)
1 parent 3206429 commit bb04d57

File tree

1 file changed

+28
-22
lines changed

1 file changed

+28
-22
lines changed

CONTRIBUTING.md

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,28 @@
22

33
First of all, thank you for contributing, you're awesome!
44

5-
To have your code integrated in the API Platform project, there is some rules to follow, but don't panic, it's easy!
5+
To have your code integrated in the API Platform project, there are some rules to follow, but don't panic, it's easy!
66

77
## Reporting Bugs
88

99
If you happen to find a bug, we kindly request you to report it. However, before submitting it, please:
1010

1111
* Check the [project documentation available online](https://api-platform.com/docs/)
1212

13-
Then, if it appears that it's a real bug, you may report it using Github by following these 3 points:
13+
Then, if it appears that it's a real bug, you may report it using GitHub by following these 3 points:
1414

1515
* Check if the bug is not already reported!
1616
* A clear title to resume the issue
1717
* A description of the workflow needed to reproduce the bug
1818

19-
> _NOTE:_ Dont hesitate giving as much information as you can (OS, PHP version extensions...)
19+
> _NOTE:_ Don't hesitate giving as much information as you can (OS, PHP version extensions...)
2020
21-
### Security issues
21+
### Security Issues
2222

2323
If you find a security issue, send a mail to Kévin Dunglas <[email protected]>. **Please do not report security problems
2424
publicly**. We will disclose details of the issue and credit you after having released a new version including a fix.
2525

26-
## Pull requests
26+
## Pull Requests
2727

2828
### Writing a Pull Request
2929

@@ -33,14 +33,14 @@ See [the dedicated documentation entry](https://api-platform.com/docs/extra/rele
3333
### Matching Coding Standards
3434

3535
The API Platform project follows [Symfony coding standards](https://symfony.com/doc/current/contributing/code/standards.html).
36-
But don't worry, you can fix CS issues automatically using the [PHP CS Fixer](http://cs.sensiolabs.org/) tool
36+
But don't worry, you can fix CS issues automatically using the [PHP CS Fixer](http://cs.sensiolabs.org/) tool:
3737

38-
```bash
38+
```shell
3939
php-cs-fixer.phar fix
4040
```
4141

42-
And then, add fixed file to your commit before push.
43-
Be sure to add only **your modified files**. If another files are fixed by cs tools, just revert it before commit.
42+
And then, add the fixed file to your commit before pushing.
43+
Be sure to add only **your modified files**. If any other file is fixed by cs tools, just revert it before committing.
4444

4545
### Sending a Pull Request
4646

@@ -52,7 +52,7 @@ When you send a PR, just make sure that:
5252
* You make the PR on the same branch you based your changes on. If you see commits
5353
that you did not make in your PR, you're doing it wrong.
5454
* Also don't forget to add a comment when you update a PR with a ping to [the maintainers](https://github.com/orgs/api-platform/people), so he/she will get a notification.
55-
* Squash your commits into one commit. (see the next chapter)
55+
* Squash your commits into one commit (see the next chapter).
5656

5757
All Pull Requests must include [this header](.github/PULL_REQUEST_TEMPLATE.md).
5858

@@ -62,23 +62,23 @@ On `api-platform/core` there are two kinds of tests: unit (`phpunit`) and integr
6262

6363
Both `phpunit` and `behat` are development dependencies and should be available in the `vendor` directory.
6464

65-
#### Phpunit and Coverage Generation
65+
#### PHPUnit and Coverage Generation
6666

6767
To launch unit tests:
6868

69-
```
69+
```shell
7070
vendor/bin/phpunit --stop-on-failure -vvv
7171
```
7272

7373
If you want coverage, you will need the `phpdbg` package and run:
7474

75-
```
75+
```shell
7676
phpdbg -qrr vendor/bin/phpunit --coverage-html coverage -vvv --stop-on-failure
7777
```
7878

7979
Sometimes there might be an error with too many open files when generating coverage. To fix this, you can increase the `ulimit`, for example:
8080

81-
```
81+
```shell
8282
ulimit -n 4000
8383
```
8484

@@ -88,15 +88,21 @@ Coverage will be available in `coverage/index.html`.
8888

8989
The command to launch Behat tests is:
9090

91-
```
91+
```shell
9292
./vendor/bin/behat --suite=default --stop-on-failure -vvv
9393
```
9494

95+
If you want to launch Behat tests for MongoDB, the command is:
96+
97+
```shell
98+
APP_ENV=mongodb ./vendor/bin/behat --suite=mongodb --stop-on-failure -vvv
99+
```
100+
95101
## Squash your Commits
96102

97-
If you have 3 commits. So start with:
103+
If you have 3 commits, start with:
98104

99-
```bash
105+
```shell
100106
git rebase -i HEAD~3
101107
```
102108

@@ -106,18 +112,18 @@ Replace all `pick` prefixes by `fixup` (or `f`) **except the first commit** of t
106112

107113
Save and quit the editor.
108114

109-
After that, all your commits where squashed into the first one and the commit message of the first commit.
115+
After that, all your commits will be squashed into the first one and the commit message will be the first one.
110116

111-
If you would like to rename your commit message type:
117+
If you would like to rename your commit message, type:
112118

113-
```bash
119+
```shell
114120
git commit --amend
115121
```
116122

117123
Now force push to update your PR:
118124

119-
```bash
120-
git push --force
125+
```shell
126+
git push --force-with-lease
121127
```
122128

123129
# License and Copyright Attribution

0 commit comments

Comments
 (0)