-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: make commit guidelines easier to reference #11732
Conversation
(first attempt to use 'hub' to use the template.. failed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking the time to do this! I definitely have some concerns about some of the links, but I do like the added header and the re-organization of the info.
CONTRIBUTING.md
Outdated
@@ -12,6 +12,9 @@ When opening new issues or commenting on existing issues on this repository | |||
please make sure discussions are related to concrete technical issues with the | |||
Node.js software. | |||
|
|||
Go to https://github.com/nodejs/node/issues/new and click the 'New Issue' button |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm definitely -1 on including the bare URL. I'm not sure any of this paragraph is needed at all. Do we have any reason to believe that people don't know how to open issues on GitHub and are looking for the information in the CONTRIBUTING.md? Most people only see the CONTRIBUTING.md when they are already opening a PR or issue because that's when GitHub shows a link to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In retrospect, I agree. :)
CONTRIBUTING.md
Outdated
@@ -12,6 +12,9 @@ When opening new issues or commenting on existing issues on this repository | |||
please make sure discussions are related to concrete technical issues with the | |||
Node.js software. | |||
|
|||
Go to https://github.com/nodejs/node/issues/new and click the 'New Issue' button | |||
and [fill out the form](.github/ISSUE_TEMPLATE.md). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This link is misleading. The text implies that you will be taken to a form. Instead, it will take you to a markdown file. I think this entire paragraph should be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call.
CONTRIBUTING.md
Outdated
@@ -203,7 +208,7 @@ $ git push origin my-branch | |||
``` | |||
|
|||
Go to https://github.com/yourusername/node and select your branch. | |||
Click the 'Pull Request' button and fill out the form. | |||
Click the 'Pull Request' button and [fill out the form](.github/PULL_REQUEST_TEMPLATE.md). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This link is misleading. The text implies that you will be taken to a form. Instead, it will take you to a markdown file. I think this entire paragraph should be removed.
lib/internal/process/next_tick.js
Outdated
@@ -2,7 +2,7 @@ | |||
|
|||
// This value is used to prevent the nextTickQueue from becoming too | |||
// large and cause the process to run out of memory. When this value | |||
// is reached the nextTimeQueue array will be shortend (see tickDone | |||
// is reached the nextTimeQueue array will be shortened (see tickDone |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bf4 could you raise this in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. Didn't know which would ultimately be more overhead
test/README.md
Outdated
@@ -5,7 +5,7 @@ This folder contains code and data used to test the Node.js implementation. | |||
For a detailed guide on how to write tests in this | |||
directory, see [the guide on writing tests](../doc/guides/writing-tests.md). | |||
|
|||
On how to run tests in this direcotry, see | |||
On how to run tests in this directory, see |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated change.
CONTRIBUTING.md
Outdated
lowercase with the exception of proper nouns, acronyms, and the ones that | ||
refer to code, like function/variable names. The description should | ||
be prefixed with the name of the changed subsystem and start with an | ||
#### Commit Message Guidelines |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 to adding a header for the formatting guidelines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also 👍 to the re-organization and consolidation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nits, but a big +1 on the new layout
CONTRIBUTING.md
Outdated
1. The first line (the header) should: | ||
- contain a short description of the change. | ||
- be 50 characters or less. | ||
- be entirely in lowercase with the exception of proper nouns, acronyms, and the ones that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the ones
-> words
CONTRIBUTING.md
Outdated
#### Commit Message Guidelines | ||
|
||
1. The first line (the header) should: | ||
- contain a short description of the change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need full stops at the end of these, it's all one run-on sentence after the colon (I guess you could use commas if you wanted to, but I don't think it's helpful).
lib/internal/process/next_tick.js
Outdated
@@ -2,7 +2,7 @@ | |||
|
|||
// This value is used to prevent the nextTickQueue from becoming too | |||
// large and cause the process to run out of memory. When this value | |||
// is reached the nextTimeQueue array will be shortend (see tickDone | |||
// is reached the nextTimeQueue array will be shortened (see tickDone |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bf4 could you raise this in a separate PR.
CONTRIBUTING.md
Outdated
be prefixed with the name of the changed subsystem and start with an | ||
#### Commit Message Guidelines | ||
|
||
1. The first line (the header) should: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the header
-> the subject line
(I've never seen it called the header)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's referred to as the header below. I was just conserving the language so that later references to 'the header' would be understandable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, but there don't seem to be any more references to "the header" as of this PR, so I think we should be fine using subject line
instead?
CONTRIBUTING.md
Outdated
- be 50 characters or less. | ||
- be entirely in lowercase with the exception of proper nouns, acronyms, and the ones that | ||
refer to code, like function/variable names. | ||
- be prefixed with the name of the changed subsystem and start with an | ||
imperative verb. Example: "net: add localAddress and localPort |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example
-> Examples
CONTRIBUTING.md
Outdated
to Socket", "src: fix typos in node_lttng_provider.h" | ||
- be meaningful; it is what other people see when they | ||
run `git shortlog` or `git log --oneline`.<br> | ||
Check the output of `git log --oneline files_that_you_changed` to find out |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe files_that_you_changed
-> files/you/changed
to emphasize that it's a path
CONTRIBUTING.md
Outdated
2. Keep the second line blank. | ||
3. Wrap all other lines at 72 columns. | ||
3. Wrap all other lines in the body at 72 columns. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the body
seems unnecessary here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added it for that same reason as #11732 (comment), where it's later referred to as the body
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, then maybe just say Wrap the body at 72 columns
, otherwise it's unclear whether there are other lines not in the body that might not need to be wrapped.
85ce194
to
80fa742
Compare
Fixes: https://github.com/nodejs/node/issues/1337 | ||
Refs: http://eslint.org/docs/rules/space-in-parens.html | ||
Refs: https://github.com/nodejs/node/pull/3615 | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ Maybe also check your commit for spelling and clarity
? :)
imperative verb. Examples: "net: add localAddress and localPort | ||
to Socket", "src: fix typos in node_lttng_provider.h" | ||
- be meaningful; it is what other people see when they | ||
run `git shortlog` or `git log --oneline`.<br> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the html <br>
is a typo here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 I thought the line break improved readability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can put a blank line in the file to get a break
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sam-github I made the 80 char change, but left the <br>
. Please review my screenshots and let me know which you prefer.
With br | without br | with blank line |
---|---|---|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't tell the difference, they all look fine
@bf4 can you change cc/ @sam-github |
CONTRIBUTING.md
Outdated
be prefixed with the name of the changed subsystem and start with an | ||
imperative verb. Example: "net: add localAddress and localPort | ||
to Socket" | ||
#### Commit Message Guidelines |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering if you think this should make a distinction between the pr title and description vs. the various commits that might make up a PR, including ones from feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think any of this applies to the PR title and description, you can do what you want with them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be worth mentioning that these rules apply to the commit message not to the PR title though, as often people aren't aware of the difference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, well, I kind of read it as meaning the pr title and description, assuming most prs are squashed. I haven't been following that in my commits since the first one....
a2a20e5
to
49451a9
Compare
@gibfahn Added link from PR Template, cc @sam-github |
.github/PULL_REQUEST_TEMPLATE.md
Outdated
@@ -13,7 +13,7 @@ Contributors guide: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md | |||
- [ ] `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes | |||
- [ ] tests and/or benchmarks are included | |||
- [ ] documentation is changed or added | |||
- [ ] commit message follows commit guidelines | |||
- [ ] commit message follows [commit guidelines](../CONTRIBUTING.md#commit-message-guidelines) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirming the ../
will link correctly when the PR is created
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirming the ../ will link correctly when the PR is created
It won't link properly when you raise a PR, as the PR comes under https://github.com/nodejs/node/compare. You can try it with a draft PR (or by editing this PR's title, but none of the relative links work:
Had a similar issue here.
EDIT: Looks like you already fixed it!
49451a9
to
13d97b8
Compare
@bf4 nice layout improvements here, can you rebase and re-push? |
13d97b8
to
adbf17f
Compare
@gibfahn @sam-github Rebased off of master; Added commit to accommodate #11792 Let me know if you'd like me to squash down to one commit. |
CONTRIBUTING.md
Outdated
1. The first line should: | ||
- contain a short description of the change | ||
- be 50 characters or less | ||
- be entirely in lowercase with the exception of proper nouns, acronyms, and the words that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrap to 80 colums
imperative verb. Examples: "net: add localAddress and localPort | ||
to Socket", "src: fix typos in node_lttng_provider.h" | ||
- be meaningful; it is what other people see when they | ||
run `git shortlog` or `git log --oneline`.<br> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can put a blank line in the file to get a break
@bf4 squashing to one commit would be helpful, thanks |
adbf17f
to
84200a4
Compare
CONTRIBUTING.md
Outdated
- be meaningful; it is what other people see when they | ||
run `git shortlog` or `git log --oneline`. | ||
|
||
Check the output of `git log --oneline files/you/changed` to find out |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
84200a4
to
17f31e0
Compare
CONTRIBUTING.md
Outdated
to Socket", "src: fix typos in node_lttng_provider.h" | ||
- be meaningful; it is what other people see when they | ||
run `git shortlog` or `git log --oneline`. | ||
Check the output of `git log --oneline files/you/changed` to find out |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Can now link to 'Commit Guidelines' from pull requests - Breaks up commit requirements and recommendations
17f31e0
to
501d159
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sam-github I made the 80 char change, but left the <br>
. Please review my screenshots and let me know which you prefer. https://github.com/nodejs/node/pull/11732/files#r109050698
I also squashed the commits and rebased against master.
Let me know what else I can do. Sorry for the delay in getting back to you.
@sam-github are you content with the latest changes? |
@gibfahn No objections from me. |
Anything else for me to do? |
Landed in bd97e48 |
- Can now link to 'Commit Guidelines' from pull requests - Breaks up commit requirements and recommendations PR-URL: #11732 Refs: #11723 (comment) Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
- Can now link to 'Commit Guidelines' from pull requests - Breaks up commit requirements and recommendations PR-URL: #11732 Refs: #11723 (comment) Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
- Can now link to 'Commit Guidelines' from pull requests - Breaks up commit requirements and recommendations PR-URL: #11732 Refs: #11723 (comment) Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
- Can now link to 'Commit Guidelines' from pull requests - Breaks up commit requirements and recommendations PR-URL: #11732 Refs: #11723 (comment) Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
- Can now link to 'Commit Guidelines' from pull requests - Breaks up commit requirements and recommendations PR-URL: #11732 Refs: #11723 (comment) Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
- Can now link to 'Commit Guidelines' from pull requests - Breaks up commit requirements and recommendations PR-URL: #11732 Refs: #11723 (comment) Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
- Can now link to 'Commit Guidelines' from pull requests - Breaks up commit requirements and recommendations PR-URL: nodejs/node#11732 Refs: nodejs/node#11723 (comment) Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
[Commit Guidelines](CONTRIBUTING.md#commit-guidelines)
from pull requestsRefs: #11723 (comment)
Checklist
Affected core subsystem(s)
None