|
| 1 | +# How to contribute to Configfile |
| 2 | + |
| 3 | +*First off, thanks for taking the time to contribute!* |
| 4 | + |
| 5 | +This file is a set of guilines for contributing to *Configfile* project. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request. |
| 6 | + |
| 7 | +#### Table of contents |
| 8 | + |
| 9 | +[How can I contribute?](#how-can-i-contribute) |
| 10 | + |
| 11 | +* [Did you find a bug?](#did-you-find-a-bug) |
| 12 | +* [Did you write a patch that fixes a bug?](#did-you-write-a-patch-that-fixes-a-bug) |
| 13 | +* [Did you fix whitespace, format code, or make a purely cosmetic patch?](#did-you-fix-whitespace-format-code-or-make-a-purely-cosmetic-patch) |
| 14 | +* [Do you intend to add a new feature or change an existing one?](#do-you-intend-to-add-a-new-feature-or-change-an-existing-one) |
| 15 | +* [Do you have questions about the source code?](#do-you-have-questions-about-the-source-code) |
| 16 | +* [Do you want to contribute to the Configfile documentation?](#do-you-want-to-contribute-to-the-Configfile-documentation) |
| 17 | + |
| 18 | +[Styleguides](#styleguides) |
| 19 | + |
| 20 | +* [JavaScript styleguide](#javaScript-styleguide) |
| 21 | +* [Git commit messages](#git-commit-messages) |
| 22 | + |
| 23 | +## How can I contribute? |
| 24 | + |
| 25 | +### Did you find a bug? |
| 26 | + |
| 27 | +* **Ensure the bug was not already reported** by searching on GitHub under [Issues][Issues]. |
| 28 | + |
| 29 | +* If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/Mindsers/configfile/issues/new). Be sure to include a **title and clear description**, as much relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring. |
| 30 | + |
| 31 | +* If possible, use the relevant bug report templates to create the issue. |
| 32 | + |
| 33 | +### Did you write a patch that fixes a bug? |
| 34 | + |
| 35 | +* Write new unit test(s) that match the bug case to limit future regression. |
| 36 | + |
| 37 | +* Open a new GitHub pull request with the patch. |
| 38 | + |
| 39 | +* Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable. |
| 40 | + |
| 41 | +* Before submitting, please ensure your code follow the code convention. |
| 42 | + |
| 43 | +### Did you fix whitespace, format code, or make a purely cosmetic patch? |
| 44 | + |
| 45 | +* Your changes must follow the coding convention. |
| 46 | + |
| 47 | +* Please ensure that your changes does not include regression. |
| 48 | + |
| 49 | +### Do you intend to add a new feature or change an existing one? |
| 50 | + |
| 51 | +* Please ask first ([open an issue][Issues] or [talk about it on gitter][gitter]) before embarking on any significant pull request (e.g. implementing features, refactoring code), otherwise you risk spending a lot of time working on something that the project's developers might not want to merge into the project. |
| 52 | + |
| 53 | +* Please adhere to the coding conventions used in this project (indentation, accurate comments, etc.) and any other requirements (such as test coverage, documentation). |
| 54 | + |
| 55 | +### Do you have questions about the source code? |
| 56 | + |
| 57 | +* Ask any question about how to use Configfile in the [gitter channel][gitter] or on [Stack Overflow](https://stackoverflow.com). |
| 58 | + |
| 59 | +### Do you want to contribute to the Configfile documentation? |
| 60 | + |
| 61 | +Documentation file are stored in the project source code. |
| 62 | + |
| 63 | +* Please refer to "Do you intend to add a new feature or change an existing one?" section. |
| 64 | + |
| 65 | +## Styleguides |
| 66 | + |
| 67 | +### JavaScript styleguide |
| 68 | + |
| 69 | +All JavaScript must adhere to [JavaScript Standard Style](https://standardjs.com). |
| 70 | + |
| 71 | +Exepctions to Standard style: |
| 72 | + |
| 73 | +* We do not want space after function name `function name(arg) { ... }` |
| 74 | + |
| 75 | +Additional rules: |
| 76 | + |
| 77 | +* Prefer spread operator (`prefer-spread`) |
| 78 | +* No useless brackets for arrow functions (`arrow-body-style`) |
| 79 | +* No useless parens for arrow functions (`arrow-parens`) |
| 80 | +* Require space before/after arrow function’s arrow (`arrow-spacing`) |
| 81 | +* `switch` must have a default case (`default-case`) |
| 82 | +* `for...in` loop must be guard by an `if` (`guard-for-in`) |
| 83 | +* Require space before the star of generator function (`generator-star-spacing`) |
| 84 | +* Getter properties must return a value (`getter-return`) |
| 85 | +* Compare to `-0` is an error (`no-compare-neg-zero`) |
| 86 | +* Use brackets if arrow function body could be confused with comparisons (`no-confusing-arrow`) |
| 87 | +* No `else` when return is used (`no-else-return`) |
| 88 | +* No empty block statements (`no-empty`) |
| 89 | +* No type conversion with shorter notations (`no-implicit-coercion`) |
| 90 | +* No useless `return` statement (`no-useless-return`) |
| 91 | +* No redeclare variables (`no-redeclare`) |
| 92 | +* Using `var` statement is an error (`no-var`) |
| 93 | +* Prefer arrow function for callback (`prefer-arrow-callback`) |
| 94 | +* Prefer using constant (`prefer-const`) |
| 95 | +* Prefer rest parameter (`prefer-rest-params`) |
| 96 | +* Prefer using template literals (`prefer-template`) |
| 97 | + |
| 98 | +All the rules are listed in `.eslinrc.json` on the root directory. |
| 99 | + |
| 100 | +### Git commit messages |
| 101 | + |
| 102 | +* Use the present tense ("Add feature" not "Added feature"). |
| 103 | + |
| 104 | +* Use the imperative mood ("Move cursor to..." not "Moves cursor to..."). |
| 105 | + |
| 106 | +* Limit the first line to 72 characters or less. |
| 107 | + |
| 108 | +* Reference issues and pull requests liberally after the first line. |
| 109 | + |
| 110 | + |
| 111 | +[Issues]: https://github.com/Mindsers/configfile/issues |
| 112 | +[gitter]: https://gitter.im/mindsers/configfile |
0 commit comments