example CONTRIBUTING.md
Here's how you can help.
In the spirit of openness, this project follows the Forking Flow, a derivative of the Gitflow model. We use Pull Requests to develop conversations around ideas, and turn ideas into actions.
Some PR Basics
[1]: if there are multiple problems you're solving, it is recommended that you create a branch for each. For example, if you are implementing a small change and realize you want to refactor an entire function, you might want to implement the refactor as your first branch (and pull request), then create a new branch (and pull request) from the refactor to implement your new feature. This helps resolve merge conflicts and separates out the logical components of the decision-making process.
[2]: include a description of the problem that is being resolved in the description field, or a reference to the issue number where the problem is reported. Examples include; "Follow Button doesn't Reflect State of Follow" or "Copy on Front-page is Converting Poorly".
[3]: notably, document the outcome of any out-of-band conversations in the pull request.
[4]: changes to marketing copy, for example, must be approved by the authority on marketing.
Detail and examples below; here are the basic principles.
You should remove whitespace at the end of lines. For example;
...should be reduced to:
The only exception is in Jade, when a single space character is inserted into the HTML document using the |
prefix.
This allows, among other things, the enduser to copy-paste blocks of text that might include various types of elements without breaking formatting.
To increase readability and reduce errors, we use the leading comma syntax when lists grow longer than 3 items in length.
This list of directives has the comma at the end of each line:
...but should be reformatted to:
Put your curly braces on the same line as the logical statement that requires them:
...should be:
Always include curly braces, even though Javascript has some cases where you can exclude them: ...should be:
For brevity in cases like this, you can reduce it to a single line, but keep your curly braces:
Logically similar blocks should be made visually pleasing where possible.
For example, without inserting any spaces to vertically align blocks:
...is much more readible when presented as follows:
For a more in-depth guide to NodeJS conventions, you can use Felix's Node Styleguide.