]>
Commit | Line | Data |
---|---|---|
dbaf49f5 SR |
1 | How to contribute to noVNC |
2 | ========================== | |
3 | ||
4 | We accept code via pull requests on GitHub. There are several guidelines that | |
5 | we expect contributors submitting code requests to follow. If you have issues | |
6 | following any of these guidelines, feel free to drop us a line by leaving a | |
7 | comment in the code request or sending us an email. | |
8 | ||
9 | Contributing Guidelines | |
10 | ----------------------- | |
11 | ||
12 | * While we don't have an official coding style guide, please try to follow | |
13 | the general coding style of the existing code. | |
14 | ** Use four spaces instead of tabs | |
15 | ** prefix private variables and functions with an `_` | |
16 | ||
17 | * Please try to include unit tests for your code. For instance, if you | |
18 | introduce a new encoding, add a test to `tests/test.rfb.js` under the | |
19 | "Encoding Handlers" section (basically, input a small pattern in your | |
20 | encoding and make sure the pattern gets displayed correctly). If you | |
21 | fix a bug, try to add a unit test that would have caught that bug | |
22 | (if possible -- some bugs, especially visual ones, are hard to test for). | |
23 | ||
24 | * Squash your commits down in to a clean commit history. For instance, there | |
25 | should not be "cleanup" commits where you fix issues in previous commits in | |
26 | the same pull request. Before you go to commit, use `git rebase -i` to | |
27 | squash these changes into the relevant commits. For instance, a good commit | |
28 | history might look like "Added support for FOO encoding, Added support for | |
29 | BAR message, Placed Button in UI to Trigger BAR" (where each comma denotes | |
30 | a separate commit). | |
31 | ||
32 | * Add both a title and description to your commit, if possible. Place more | |
33 | detail on what you did in the description. | |
34 | ||
35 | Running the unit tests | |
36 | ---------------------- | |
37 | ||
dfae3209 SR |
38 | We use Karma to run our tests. You can launch karma manually, or simply |
39 | run `npm test`. The Karma debug page will display the tests in normal | |
40 | mocha form, if you need it. | |
dbaf49f5 SR |
41 | |
42 | Thanks, and happy coding! |