Bill Wendling | 7d62345 | 2015-03-18 13:36:07 -0700 | [diff] [blame] | 1 | Want to contribute? Great! First, read this page (including the small print at the end). |
| 2 | |
Eli Bendersky | cd0aa2f | 2015-03-19 06:22:10 -0700 | [diff] [blame] | 3 | Before you contribute |
| 4 | --------------------- |
| 5 | |
| 6 | Before we can use your code, you must sign the `Google Individual Contributor |
| 7 | License Agreement |
| 8 | <https://developers.google.com/open-source/cla/individual?csw=1>`_ (CLA), which |
| 9 | you can do online. The CLA is necessary mainly because you own the |
Bill Wendling | 7d62345 | 2015-03-18 13:36:07 -0700 | [diff] [blame] | 10 | copyright to your changes, even after your contribution becomes part of our |
| 11 | codebase, so we need your permission to use and distribute your code. We also |
| 12 | need to be sure of various other things—for instance that you'll tell us if you |
| 13 | know that your code infringes on other people's patents. You don't have to sign |
| 14 | the CLA until after you've submitted your code for review and a member has |
| 15 | approved it, but you must do it before we can put your code into our codebase. |
| 16 | Before you start working on a larger contribution, you should get in touch with |
| 17 | us first through the issue tracker with your idea so that we can help out and |
| 18 | possibly guide you. Coordinating up front makes it much easier to avoid |
| 19 | frustration later on. |
| 20 | |
Eli Bendersky | cd0aa2f | 2015-03-19 06:22:10 -0700 | [diff] [blame] | 21 | Code reviews |
| 22 | ------------ |
| 23 | |
Bill Wendling | 7d62345 | 2015-03-18 13:36:07 -0700 | [diff] [blame] | 24 | All submissions, including submissions by project members, require review. We |
| 25 | use Github pull requests for this purpose. |
| 26 | |
Eli Bendersky | cd0aa2f | 2015-03-19 06:22:10 -0700 | [diff] [blame] | 27 | YAPF coding style |
| 28 | ----------------- |
| 29 | |
Bill Wendling | c7e9b78 | 2015-04-09 16:02:23 -0400 | [diff] [blame] | 30 | YAPF follows the `Chromium Python Style Guide |
| 31 | <https://www.chromium.org/chromium-os/python-style-guidelines>`_. It's the same |
| 32 | as the Google Python Style guide with two exceptions: |
Sam Clegg | 4357fa3 | 2015-04-08 12:21:46 -0700 | [diff] [blame] | 33 | |
| 34 | - 2 spaces for indentation rather than 4. |
| 35 | - CamelCase for function and method names rather than words_with_underscores. |
| 36 | |
Bill Wendling | cfcf45f | 2017-10-05 15:54:09 -0700 | [diff] [blame] | 37 | The rationale for this is that YAPF was initially developed at Google where |
| 38 | these two exceptions are still part of the internal Python style guide. |
Eli Bendersky | cd0aa2f | 2015-03-19 06:22:10 -0700 | [diff] [blame] | 39 | |
| 40 | Small print |
| 41 | ----------- |
| 42 | |
Bill Wendling | 7d62345 | 2015-03-18 13:36:07 -0700 | [diff] [blame] | 43 | Contributions made by corporations are covered by a different agreement than |
| 44 | the one above, the Software Grant and Corporate Contributor License Agreement. |