Skip to content

Commit 07eaa6a

Browse files
committed
[squash]tree-factor
1 parent d8f688e commit 07eaa6a

File tree

4 files changed

+66
-74
lines changed

4 files changed

+66
-74
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ trademark) should use the
2020

2121
## Code Contributions
2222

23+
For some contribution "Best Practices" have a look at [this guide](doc/guides/best-practices-for-a-successful-pr.md)
24+
2325
This section will guide you through the contribution process.
2426

2527
### Step 1: Fork
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Best Practices
2+
<sub>(a.k.a "Rules of thumb")</sub>
3+
4+
## Provide motivation for the change
5+
Try to explain why this change will make the code better. For example, does
6+
it fix a bug, or is it a new feature, etc. This should be expressed in the
7+
commit messages as well as in the PR description.
8+
9+
## Don't make _unnecessary_ code changes
10+
_Unnecessary_ code changes are changes made because of personal preference
11+
or style. For example, renaming of variables or functions, adding or removing
12+
white spaces, and reordering lines or whole code blocks. These sort of
13+
changes should have a good reason since otherwise they cause unnecessary
14+
[code churn][5] As part of the project's strategy we maintain multiple release
15+
lines, code churn might hinder back-porting changes to other lines. Also when
16+
you change a line, your name will come up in `git blame` and shadow the name of
17+
the previous author of that line.
18+
19+
## Keep the change-set self contained but at a reasonable size
20+
Use good judgment when making a big change. If a reason does not come to mind
21+
but a very big change needs to be made, try to break it into smaller
22+
pieces (still as self-contained as possible), and cross-reference them,
23+
explicitly stating that they are dependent on each other.
24+
25+
## Be aware of our style rules
26+
As part of accepting a PR the changes __must__ pass our linters.
27+
* For C++ we use Google's `cpplint` (with some adjustments) so following their
28+
[style-guide][1] should make your code
29+
compliant with our linter.
30+
* For JS we use this [rule-set][2]
31+
for ESLint plus some of [our own custom rules][3].
32+
* For markdown we have a [style guide][4]
33+
34+
[1]: https://github.com/google/styleguide "Google C++ style guide"
35+
[2]: https://github.com/nodejs/node/blob/master/.eslintrc.yaml "eslintrc"
36+
[3]: https://github.com/nodejs/node/tree/master/tools/eslint-rules "Our Rules"
37+
[4]: https://github.com/nodejs/node/blob/master/doc/STYLE_GUIDE.md "MD Style"
38+
[5]: https://blog.gitprime.com/why-code-churn-matters "Why churm matters"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Tips & Troubleshooting for working with the `node` code
2+
3+
## Tips
4+
5+
1. If you build the code often, you should check out [`ninja`]. You may
6+
find it to be faster than `make`, much much faster than `MSBuild` (Windows), and less eager to rebuild unchanged
7+
sub-targets.
8+
9+
[`ninja`]: ./building-node-with-ninja.md
10+
11+
12+
## Troubleshooting
13+
14+
1. __Python crashes with `LookupError: unknown encoding: cp65001`__:
15+
This is a known `Windows`/`python` bug ([_python bug_][1],
16+
[_stack overflow_][2]). The simplest solution is to set an
17+
environment variable which tells `python` how to handle this situation:
18+
```cmd
19+
set PYTHONIOENCODING=UTF-8
20+
```
21+
22+
[1]: http://bugs.python.org/issue1602 "python bug"
23+
[2]: http://stackoverflow.com/questions/878972/windows-cmd-encoding-change-causes-python-crash "stack overflow"
24+
25+
26+

doc/guides/tips-tricks-and-troubleshooting.md

Lines changed: 0 additions & 74 deletions
This file was deleted.

0 commit comments

Comments
 (0)