Skip to content

Commit 0258aed

Browse files
committed
doc: edit CONTRIBUTING.md for clarity etc.
PR-URL: #12796 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 712596f commit 0258aed

File tree

1 file changed

+49
-64
lines changed

1 file changed

+49
-64
lines changed

CONTRIBUTING.md

+49-64
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,30 @@
22

33
## Code of Conduct
44

5-
The Code of Conduct explains the *bare minimum* behavior
6-
expectations the Node Foundation requires of its contributors.
7-
[Please read it before participating.](https://github.com/nodejs/TSC/blob/master/CODE_OF_CONDUCT.md)
5+
Please read the
6+
[Code of Conduct](https://github.com/nodejs/TSC/blob/master/CODE_OF_CONDUCT.md)
7+
which explains the minimum behavior expectations for Node.js contributors.
88

99
## Issue Contributions
1010

11-
When opening new issues or commenting on existing issues on this repository
12-
please make sure discussions are related to concrete technical issues with the
13-
Node.js software.
11+
When opening issues or commenting on existing issues, please make sure
12+
discussions are related to concrete technical issues with Node.js.
1413

15-
For general help using Node.js, please file an issue at the
14+
* For general help using Node.js, please file an issue at the
1615
[Node.js help repository](https://github.com/nodejs/help/issues).
1716

18-
Discussion of non-technical topics including subjects like intellectual
19-
property, trademark, and high level project questions should move to the
20-
[Technical Steering Committee (TSC)](https://github.com/nodejs/TSC/issues)
21-
instead.
17+
* Discussion of non-technical topics (such as intellectual property and
18+
trademark) should use the
19+
[Technical Steering Committee (TSC) repository](https://github.com/nodejs/TSC/issues).
2220

2321
## Code Contributions
2422

25-
The Node.js project has an open governance model and welcomes new contributors.
26-
Individuals making significant and valuable contributions are made
27-
_Collaborators_ and given commit-access to the project. See the
28-
[GOVERNANCE.md](./GOVERNANCE.md) document for more information about how this
29-
works.
30-
31-
This document will guide you through the contribution process.
23+
This section will guide you through the contribution process.
3224

3325
### Step 1: Fork
3426

35-
Fork the project [on GitHub](https://github.com/nodejs/node) and check out your
36-
copy locally.
27+
Fork the project [on GitHub](https://github.com/nodejs/node) and clone your fork
28+
locally.
3729

3830
```text
3931
$ git clone [email protected]:username/node.git
@@ -49,24 +41,18 @@ and built upon.
4941
#### Dependencies
5042

5143
Node.js has several bundled dependencies in the *deps/* and the *tools/*
52-
directories that are not part of the project proper. Any changes to files
53-
in those directories or its subdirectories should be sent to their respective
54-
projects. Do not send a patch to Node.js. We cannot accept such patches.
44+
directories that are not part of the project proper. Changes to files in those
45+
directories should be sent to their respective projects. Do not send a patch to
46+
Node.js. We cannot accept such patches.
5547

5648
In case of doubt, open an issue in the
5749
[issue tracker](https://github.com/nodejs/node/issues/) or contact one of the
5850
[project Collaborators](https://github.com/nodejs/node/#current-project-team-members).
59-
Especially do so if you plan to work on something big. Nothing is more
60-
frustrating than seeing your hard work go to waste because your vision
61-
does not align with the project team. (Node.js has two IRC channels:
51+
Node.js has two IRC channels:
6252
[#Node.js](http://webchat.freenode.net/?channels=node.js) for general help and
6353
questions, and
6454
[#Node-dev](http://webchat.freenode.net/?channels=node-dev) for development of
65-
Node.js core specifically).
66-
67-
For instructions on updating the version of V8 included in the *deps/*
68-
directory, please refer to [the Maintaining V8 in Node.js guide](https://github.com/nodejs/node/blob/master/doc/guides/maintaining-V8.md).
69-
55+
Node.js core specifically.
7056

7157
### Step 2: Branch
7258

@@ -95,35 +81,37 @@ $ git add my/changed/files
9581
$ git commit
9682
```
9783

98-
### Commit guidelines
84+
### Commit message guidelines
9985

100-
Writing good commit logs is important. A commit log should describe what
101-
changed and why. Follow these guidelines when writing one:
86+
The commit message should describe what changed and why.
10287

10388
1. The first line should:
10489
- contain a short description of the change
10590
- be 50 characters or less
10691
- be entirely in lowercase with the exception of proper nouns, acronyms, and
10792
the words that refer to code, like function/variable names
10893
- be prefixed with the name of the changed subsystem and start with an
109-
imperative verb. Examples: "net: add localAddress and localPort
110-
to Socket", "src: fix typos in node_lttng_provider.h"
111-
- be meaningful; it is what other people see when they
112-
run `git shortlog` or `git log --oneline`.<br>
113-
Check the output of `git log --oneline files/you/changed` to find out
114-
what subsystem (or subsystems) your changes touch
94+
imperative verb. Check the output of `git log --oneline files/you/changed` to
95+
find out what subsystems your changes touch.
96+
97+
Examples:
98+
- `net: add localAddress and localPort to Socket`
99+
- `src: fix typos in node_lttng_provider.h`
100+
101+
115102
2. Keep the second line blank.
116103
3. Wrap all other lines at 72 columns.
117-
- If your patch fixes an open issue, you can add a reference to it at the end
118-
of the log. Use the `Fixes:` prefix and the full issue URL. For other references
119-
use `Refs:`. For example:
120-
```txt
121-
Fixes: https://github.com/nodejs/node/issues/1337
122-
Refs: http://eslint.org/docs/rules/space-in-parens.html
123-
Refs: https://github.com/nodejs/node/pull/3615
124-
```
125104

126-
A good commit log can look something like this:
105+
4. If your patch fixes an open issue, you can add a reference to it at the end
106+
of the log. Use the `Fixes:` prefix and the full issue URL. For other references
107+
use `Refs:`.
108+
109+
Examples:
110+
- `Fixes: https://github.com/nodejs/node/issues/1337`
111+
- `Refs: http://eslint.org/docs/rules/space-in-parens.html`
112+
- `Refs: https://github.com/nodejs/node/pull/3615`
113+
114+
Sample complete commit message:
127115

128116
```txt
129117
subsystem: explain the commit in one line
@@ -143,7 +131,8 @@ Refs: http://eslint.org/docs/rules/space-in-parens.html
143131

144132
### Step 4: Rebase
145133

146-
Use `git rebase` (not `git merge`) to sync your work from time to time.
134+
Use `git rebase` (not `git merge`) to synchronize your work with the main
135+
repository.
147136

148137
```text
149138
$ git fetch upstream
@@ -152,12 +141,12 @@ $ git rebase upstream/master
152141

153142
### Step 5: Test
154143

155-
Bug fixes and features **should come with tests**. Add your tests in the
156-
`test/parallel/` directory. For guidance on how to write a test for the Node.js
157-
project, see this [guide](./doc/guides/writing-tests.md). Looking at other tests
158-
to see how they should be structured can also help.
144+
Bug fixes and features should come with tests. Read the
145+
[guide for writing tests in Node.js](./doc/guides/writing-tests.md). Looking at
146+
other tests to see how they should be structured can also help. Add your
147+
tests in the `test/parallel/` directory if you are unsure where to put them.
159148

160-
To run the tests on Unix / macOS:
149+
To run the tests (including code linting) on Unix / macOS:
161150

162151
```text
163152
$ ./configure && make -j4 test
@@ -174,28 +163,24 @@ Windows:
174163
Make sure the linter does not report any issues and that all tests pass. Please
175164
do not submit patches that fail either check.
176165

177-
Running `make test`/`vcbuild test` will run the linter as well unless one or
178-
more tests fail.
179-
180166
If you want to run the linter without running tests, use
181167
`make lint`/`vcbuild lint`. It will run both JavaScript linting and
182168
C++ linting.
183169

184-
If you are updating tests and just want to run a single test to check it, you
185-
can use this syntax to run it exactly as the test harness would:
170+
If you are updating tests and just want to run a single test to check it:
186171

187172
```text
188173
$ python tools/test.py -v --mode=release parallel/test-stream2-transform
189174
```
190175

191-
You can run tests directly with node:
176+
You can usually run tests directly with node:
192177

193178
```text
194179
$ ./node ./test/parallel/test-stream2-transform.js
195180
```
196181

197-
Remember to recompile with `make -j4` in between test runs if you change
198-
core modules.
182+
Remember to recompile with `make -j4` in between test runs if you change code in
183+
the `lib` or `src` directories.
199184

200185
### Step 6: Push
201186

@@ -208,7 +193,7 @@ Pull requests are usually reviewed within a few days.
208193
### Step 7: Discuss and update
209194

210195
You will probably get feedback or requests for changes to your Pull Request.
211-
This is a big part of the submission process so don't be disheartened!
196+
This is a big part of the submission process so don't be discouraged!
212197

213198
To make changes to an existing Pull Request, make the changes to your branch.
214199
When you push that branch to your fork, GitHub will automatically update the

0 commit comments

Comments
 (0)