|
1 | 1 | Want to contribute? Great! First, read this page (including the small print at the end).
|
2 | 2 |
|
3 |
| -### Before you contribute |
| 3 | +## Before you contribute |
4 | 4 | Before we can use your code, you must sign the
|
5 | 5 | [Google Individual Contributor License Agreement](https://developers.google.com/open-source/cla/individual?csw=1)
|
6 |
| -(CLA), which you can do online. The CLA is necessary mainly because you own the |
| 6 | +(CLA), which you can do online. |
| 7 | + |
| 8 | +The CLA is necessary mainly because you own the |
7 | 9 | copyright to your changes, even after your contribution becomes part of our
|
8 | 10 | codebase, so we need your permission to use and distribute your code. We also
|
9 | 11 | need to be sure of various other things—for instance that you'll tell us if you
|
10 |
| -know that your code infringes on other people's patents. You don't have to sign |
| 12 | +know that your code infringes on other people's patents. |
| 13 | + |
| 14 | +You don't have to sign |
11 | 15 | the CLA until after you've submitted your code for review and a member has
|
12 | 16 | approved it, but you must do it before we can put your code into our codebase.
|
13 | 17 | Before you start working on a larger contribution, you should get in touch with
|
14 | 18 | us first through the issue tracker with your idea so that we can help out and
|
15 | 19 | possibly guide you. Coordinating up front makes it much easier to avoid
|
16 | 20 | frustration later on.
|
17 | 21 |
|
18 |
| -### Code reviews |
| 22 | +## Code reviews |
19 | 23 | All submissions, including submissions by project members, require review. We
|
20 | 24 | use Github pull requests for this purpose.
|
21 | 25 |
|
22 |
| -### The small print |
| 26 | +## Code Style |
| 27 | +Programs written in Go must be formatted with `gofmt`. For other languages, we use the |
| 28 | +[Google style guides](https://google.github.io/styleguide/) for code styling. Specifically, this means: |
| 29 | + |
| 30 | +* Line length: 80 chars (Java 100) |
| 31 | +* No extra whitespace around arguments `(code)` not `( code )` |
| 32 | +* K & R style braces: |
| 33 | +```java |
| 34 | +if (condition()) { |
| 35 | + something(); |
| 36 | +} else { |
| 37 | + somethingElse(); |
| 38 | +} |
| 39 | +``` |
| 40 | + |
| 41 | +## The small print |
23 | 42 | Contributions made by corporations are covered by a different agreement than
|
24 | 43 | the one above, the Software Grant and Corporate Contributor License Agreement.
|
0 commit comments