You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Create your patch, **including appropriate test cases**.
81
+
- Follow our [Coding Rules](#rules).
82
+
- Run the full test suite using `npm test` and ensure that all tests pass.
83
+
- Commit your changes using a descriptive commit message that follows our
80
84
[commit message conventions](#commit-message-format) and passes our commit message presubmit hook. Adherence to the [commit message conventions](#commit-message-format) is required because release notes are automatically generated from these messages.
81
-
* Push your branch to GitHub:
85
+
- Push your branch to GitHub:
82
86
83
87
```shell
84
88
git push origin fix/my-fix-branch
85
89
```
86
90
87
-
* In GitHub, send a pull request to `dadi/api:master`.
88
-
* If we suggest changes then:
89
-
* Make the required updates.
90
-
* Re-run the full test suite to ensure tests are still passing.
91
-
* Commit your changes to your branch (e.g. `fix/my-fix-branch`).
92
-
* Push the changes to GitHub (this will update your Pull Request).
91
+
- In GitHub, send a pull request to `dadi/api:master`.
92
+
- If we suggest changes then:
93
+
- Make the required updates.
94
+
- Re-run the full test suite to ensure tests are still passing.
95
+
- Commit your changes to your branch (e.g. `fix/my-fix-branch`).
96
+
- Push the changes to GitHub (this will update your Pull Request).
93
97
94
98
If the pull request gets too outdated we may ask you to rebase and force push to update the pull request:
95
99
@@ -98,50 +102,51 @@ git rebase master -i
98
102
git push origin fix/my-fix-branch -f
99
103
```
100
104
101
-
*WARNING. Squashing or reverting commits and forced push thereafter may remove GitHub comments on code that were previously made by you and others in your commits.*
105
+
_WARNING. Squashing or reverting commits and forced push thereafter may remove GitHub comments on code that were previously made by you and others in your commits._
102
106
103
-
* Documentation! Please add relevant documentation to the pull request. If this is a new feature then
104
-
please document it fully within the pull request. If you're making changes to an existing feature, please
105
-
give us a link to the existing [documentation][docs] along with your documentation changes. If you need
106
-
an example of excellent pull request documentation, have a look at the [effort put in here](https://github.com/dadi/api/pull/27).
107
+
- Documentation! Please add relevant documentation to the pull request. If this is a new feature then
108
+
please document it fully within the pull request. If you're making changes to an existing feature, please
109
+
give us a link to the existing [documentation][docs] along with your documentation changes. If you need
110
+
an example of excellent pull request documentation, have a look at the [effort put in here](https://github.com/dadi/api/pull/27).
107
111
108
112
> That's it! Thank you for your contribution!
109
113
110
114
#### After your pull request is merged
111
115
112
116
After your pull request is merged, you can safely delete your branch and pull the changes from the main (upstream) repository:
113
117
114
-
* Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:
118
+
- Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:
115
119
116
120
```shell
117
121
git push origin --delete my-fix-branch
118
122
```
119
123
120
-
* Check out the master branch:
124
+
- Check out the master branch:
121
125
122
126
```shell
123
127
git checkout master -f
124
128
```
125
129
126
-
* Delete the local branch:
130
+
- Delete the local branch:
127
131
128
132
```shell
129
133
git branch -D my-fix-branch
130
134
```
131
135
132
-
* Update your master with the latest upstream version:
136
+
- Update your master with the latest upstream version:
133
137
134
138
```shell
135
139
git pull --ff upstream master
136
140
```
137
141
138
142
## <aname="rules"></a> Coding Rules
143
+
139
144
To ensure consistency throughout the source code, keep these rules in mind as you are working:
140
145
141
-
* Please use **two-space indentation**, as used in Node.JS itself.
142
-
* All features or bug fixes **must be tested** by one or more tests. Browse the [test
143
-
suite][tests] for examples.
144
-
* All public API methods **must be documented** with [JSDoc](http://usejsdoc.org/).
146
+
- Please use **two-space indentation**, as used in Node.JS itself.
147
+
- All features or bug fixes **must be tested** by one or more tests. Browse the [test
148
+
suite][tests] for examples.
149
+
- All public API methods **must be documented** with [JSDoc](http://usejsdoc.org/).
145
150
146
151
## <aname="commit"></a> Git Commit Guidelines
147
152
@@ -153,7 +158,7 @@ Please don't include more than one change in each patch. If your commit message
153
158
154
159
### Commit Message Format
155
160
156
-
We have very precise rules over how our git commit messages can be formatted. This leads to **more readable messages** that are easy to follow when looking through the **project history**. We also use the git commit messages to **generate the change log**.
161
+
We have very precise rules over how our git commit messages can be formatted. This leads to **more readable messages** that are easy to follow when looking through the **project history**. We also use the git commit messages to **generate the change log**.
157
162
158
163
We use [husky](https://www.npmjs.com/package/husky) and [validate-commit-msg](https://github.com/kentcdodds/validate-commit-msg) to perform the commit message validation. Commit messages will be validated when you commit. When validation fails, you'll see a message similar to the following:
159
164
@@ -169,7 +174,7 @@ Any line of the commit message cannot be longer 100 characters. This allows the
169
174
170
175
#### Message Format
171
176
172
-
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special format that includes a **type** and a **subject**:
177
+
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special format that includes a **type** and a **subject**:
173
178
174
179
```
175
180
type: subject
@@ -181,43 +186,47 @@ Close #yyy
181
186
Ref #zzz
182
187
```
183
188
184
-
* Use `Fix #xxx` when the commit fixes an open issue.
185
-
* Use `Close #xxx` when the commit closes an open pull request.
186
-
* Use `Ref #xxx` when referencing an issue or pull request that is already closed or should remain open. Examples include partial fixes and commits that add a test but not a fix.
189
+
- Use `Fix #xxx` when the commit fixes an open issue.
190
+
- Use `Close #xxx` when the commit closes an open pull request.
191
+
- Use `Ref #xxx` when referencing an issue or pull request that is already closed or should remain open. Examples include partial fixes and commits that add a test but not a fix.
187
192
188
193
### Reverting
189
-
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
194
+
195
+
If the commit reverts a previous commit, it should begin with `revert:`, followed by the header of the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
190
196
191
197
### Type
198
+
192
199
Must be one of the following:
193
200
194
-
***feat**: A new feature
195
-
***fix**: A bug fix
196
-
***docs**: Documentation only changes
197
-
***style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
198
-
***refactor**: A code change that neither fixes a bug nor adds a feature
199
-
***perf**: A code change that improves performance
200
-
***test**: Adding missing tests
201
-
***chore**: Changes to the build process or auxiliary tools and libraries such as documentation generation
201
+
-**feat**: A new feature
202
+
-**fix**: A bug fix
203
+
-**docs**: Documentation only changes
204
+
-**style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
205
+
-**refactor**: A code change that neither fixes a bug nor adds a feature
206
+
-**perf**: A code change that improves performance
207
+
-**test**: Adding missing tests
208
+
-**chore**: Changes to the build process or auxiliary tools and libraries such as documentation generation
202
209
203
210
### Subject
211
+
204
212
The subject contains a succinct description of the change:
205
213
206
-
* use the imperative, present tense: "fix" not "fixed" nor "fixes"
207
-
* don't capitalize first letter
208
-
* no dot (.) at the end
214
+
- use the imperative, present tense: "fix" not "fixed" nor "fixes"
215
+
- don't capitalize first letter
216
+
- no dot (.) at the end
209
217
210
218
### Body
219
+
211
220
Just as in the **subject**, write your commit message in the imperative: "Fix bug" and not "Fixed bug" or "Fixes bug". This convention matches up with commit messages generated by commands like `git merge` and `git revert`.
212
221
213
222
The body should include the motivation for the change and contrast this with previous behavior.
214
223
215
224
### Footer
225
+
216
226
The footer should contain any information about **Breaking Changes** and is also the place to reference GitHub issues that this commit **Closes**.
217
227
218
228
**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.
0 commit comments