Skip to content

Commit 1a65497

Browse files
authored
Update CONTRIBUTING.md
Add section about code style.
1 parent 310f200 commit 1a65497

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

CONTRIBUTING.md

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,43 @@
11
Want to contribute? Great! First, read this page (including the small print at the end).
22

3-
### Before you contribute
3+
## Before you contribute
44
Before we can use your code, you must sign the
55
[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
79
copyright to your changes, even after your contribution becomes part of our
810
codebase, so we need your permission to use and distribute your code. We also
911
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
1115
the CLA until after you've submitted your code for review and a member has
1216
approved it, but you must do it before we can put your code into our codebase.
1317
Before you start working on a larger contribution, you should get in touch with
1418
us first through the issue tracker with your idea so that we can help out and
1519
possibly guide you. Coordinating up front makes it much easier to avoid
1620
frustration later on.
1721

18-
### Code reviews
22+
## Code reviews
1923
All submissions, including submissions by project members, require review. We
2024
use Github pull requests for this purpose.
2125

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
2342
Contributions made by corporations are covered by a different agreement than
2443
the one above, the Software Grant and Corporate Contributor License Agreement.

0 commit comments

Comments
 (0)