• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Contributing    {#contributing}
2============
3
4Want to contribute? Great! First, read this page (including the small print at
5the end).
6
7# Before you contribute
8Before we can use your code, you must sign the
9[Google Individual Contributor License Agreement](https://developers.google.com/open-source/cla/individual?csw=1)
10(CLA), which you can do online. The CLA is necessary mainly because you own the
11copyright to your changes, even after your contribution becomes part of our
12codebase, so we need your permission to use and distribute your code. We also
13need to be sure of various other things—for instance that you'll tell us if you
14know that your code infringes on other people's patents. You don't have to sign
15the CLA until after you've submitted your code for review and a member has
16approved it, but you must do it before we can put your code into our codebase.
17Before you start working on a larger contribution, you should get in touch with
18us first through the issue tracker with your idea so that we can help out and
19possibly guide you. Coordinating up front makes it much easier to avoid
20frustration later on.
21
22# Code reviews
23All submissions, including submissions by project members, require review. We
24use Github pull requests for this purpose.
25
26Some tips for good pull requests:
27* Use our code
28  [style guide](https://google.github.io/styleguide/cppguide.html).
29  When in doubt, try to stay true to the existing code of the project.
30* Write a descriptive commit message. What problem are you solving and what
31  are the consequences? Where and what did you test? Some good tips:
32  [here](http://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message)
33  and [here](https://www.kernel.org/doc/Documentation/SubmittingPatches).
34* If your PR consists of multiple commits which are successive improvements /
35  fixes to your first commit, consider squashing them into a single commit
36  (`git rebase -i`) such that your PR is a single commit on top of the current
37  HEAD. This make reviewing the code so much easier, and our history more
38  readable.
39
40# The small print
41Contributions made by corporations are covered by a different agreement than
42the one above, the Software Grant and Corporate Contributor License Agreement.
43