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**.
82
+
- Follow our [Coding Rules](#rules).
83
+
- Run the full test suite using `npm test` and ensure that all tests pass.
84
+
- Commit your changes using a descriptive commit message that follows our
80
85
[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:
86
+
- Push your branch to GitHub:
82
87
83
88
```shell
84
89
git push origin fix/my-fix-branch
85
90
```
86
91
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).
92
+
- In GitHub, send a pull request to `dadi/api:master`.
93
+
- If we suggest changes then:
94
+
- Make the required updates.
95
+
- Re-run the full test suite to ensure tests are still passing.
96
+
- Commit your changes to your branch (e.g. `fix/my-fix-branch`).
97
+
- Push the changes to GitHub (this will update your Pull Request).
93
98
94
99
If the pull request gets too outdated we may ask you to rebase and force push to update the pull request:
95
100
@@ -98,50 +103,51 @@ git rebase master -i
98
103
git push origin fix/my-fix-branch -f
99
104
```
100
105
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.*
106
+
_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
107
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).
108
+
- Documentation! Please add relevant documentation to the pull request. If this is a new feature then
109
+
please document it fully within the pull request. If you're making changes to an existing feature, please
110
+
give us a link to the existing [documentation][docs] along with your documentation changes. If you need
111
+
an example of excellent pull request documentation, have a look at the [effort put in here](https://github.com/dadi/api/pull/27).
107
112
108
113
> That's it! Thank you for your contribution!
109
114
110
115
#### After your pull request is merged
111
116
112
117
After your pull request is merged, you can safely delete your branch and pull the changes from the main (upstream) repository:
113
118
114
-
* Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:
119
+
- Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:
115
120
116
121
```shell
117
122
git push origin --delete my-fix-branch
118
123
```
119
124
120
-
* Check out the master branch:
125
+
- Check out the master branch:
121
126
122
127
```shell
123
128
git checkout master -f
124
129
```
125
130
126
-
* Delete the local branch:
131
+
- Delete the local branch:
127
132
128
133
```shell
129
134
git branch -D my-fix-branch
130
135
```
131
136
132
-
* Update your master with the latest upstream version:
137
+
- Update your master with the latest upstream version:
133
138
134
139
```shell
135
140
git pull --ff upstream master
136
141
```
137
142
138
143
## <aname="rules"></a> Coding Rules
144
+
139
145
To ensure consistency throughout the source code, keep these rules in mind as you are working:
140
146
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/).
147
+
- Please use **two-space indentation**, as used in Node.JS itself.
148
+
- All features or bug fixes **must be tested** by one or more tests. Browse the [test
149
+
suite][tests] for examples.
150
+
- All public API methods **must be documented** with [JSDoc](http://usejsdoc.org/).
145
151
146
152
## <aname="commit"></a> Git Commit Guidelines
147
153
@@ -153,7 +159,7 @@ Please don't include more than one change in each patch. If your commit message
153
159
154
160
### Commit Message Format
155
161
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**.
162
+
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
163
158
164
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
165
@@ -169,7 +175,7 @@ Any line of the commit message cannot be longer 100 characters. This allows the
169
175
170
176
#### Message Format
171
177
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**:
178
+
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
179
174
180
```
175
181
type: subject
@@ -181,43 +187,47 @@ Close #yyy
181
187
Ref #zzz
182
188
```
183
189
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.
190
+
- Use `Fix #xxx` when the commit fixes an open issue.
191
+
- Use `Close #xxx` when the commit closes an open pull request.
192
+
- 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
193
188
194
### 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.
195
+
196
+
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
197
191
198
### Type
199
+
192
200
Must be one of the following:
193
201
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
202
+
-**feat**: A new feature
203
+
-**fix**: A bug fix
204
+
-**docs**: Documentation only changes
205
+
-**style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
206
+
-**refactor**: A code change that neither fixes a bug nor adds a feature
207
+
-**perf**: A code change that improves performance
208
+
-**test**: Adding missing tests
209
+
-**chore**: Changes to the build process or auxiliary tools and libraries such as documentation generation
202
210
203
211
### Subject
212
+
204
213
The subject contains a succinct description of the change:
205
214
206
-
* use the imperative, present tense: "fix" not "fixed" nor "fixes"
207
-
* don't capitalize first letter
208
-
* no dot (.) at the end
215
+
- use the imperative, present tense: "fix" not "fixed" nor "fixes"
216
+
- don't capitalize first letter
217
+
- no dot (.) at the end
209
218
210
219
### Body
220
+
211
221
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
222
213
223
The body should include the motivation for the change and contrast this with previous behavior.
214
224
215
225
### Footer
226
+
216
227
The footer should contain any information about **Breaking Changes** and is also the place to reference GitHub issues that this commit **Closes**.
217
228
218
229
**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