xref: /aosp_15_r20/external/yapf/CONTRIBUTING.rst (revision 7249d1a64f4850ccf838e62a46276f891f72998e)
1*7249d1a6SKrzysztof KosińskiWant to contribute? Great! First, read this page (including the small print at the end).
2*7249d1a6SKrzysztof Kosiński
3*7249d1a6SKrzysztof KosińskiBefore you contribute
4*7249d1a6SKrzysztof Kosiński---------------------
5*7249d1a6SKrzysztof Kosiński
6*7249d1a6SKrzysztof KosińskiBefore we can use your code, you must sign the `Google Individual Contributor
7*7249d1a6SKrzysztof KosińskiLicense Agreement
8*7249d1a6SKrzysztof Kosiński<https://developers.google.com/open-source/cla/individual?csw=1>`_ (CLA), which
9*7249d1a6SKrzysztof Kosińskiyou can do online. The CLA is necessary mainly because you own the
10*7249d1a6SKrzysztof Kosińskicopyright to your changes, even after your contribution becomes part of our
11*7249d1a6SKrzysztof Kosińskicodebase, so we need your permission to use and distribute your code. We also
12*7249d1a6SKrzysztof Kosińskineed to be sure of various other things—for instance that you'll tell us if you
13*7249d1a6SKrzysztof Kosińskiknow that your code infringes on other people's patents. You don't have to sign
14*7249d1a6SKrzysztof Kosińskithe CLA until after you've submitted your code for review and a member has
15*7249d1a6SKrzysztof Kosińskiapproved it, but you must do it before we can put your code into our codebase.
16*7249d1a6SKrzysztof KosińskiBefore you start working on a larger contribution, you should get in touch with
17*7249d1a6SKrzysztof Kosińskius first through the issue tracker with your idea so that we can help out and
18*7249d1a6SKrzysztof Kosińskipossibly guide you. Coordinating up front makes it much easier to avoid
19*7249d1a6SKrzysztof Kosińskifrustration later on.
20*7249d1a6SKrzysztof Kosiński
21*7249d1a6SKrzysztof KosińskiCode reviews
22*7249d1a6SKrzysztof Kosiński------------
23*7249d1a6SKrzysztof Kosiński
24*7249d1a6SKrzysztof KosińskiAll submissions, including submissions by project members, require review. We
25*7249d1a6SKrzysztof Kosińskiuse Github pull requests for this purpose.
26*7249d1a6SKrzysztof Kosiński
27*7249d1a6SKrzysztof KosińskiYAPF coding style
28*7249d1a6SKrzysztof Kosiński-----------------
29*7249d1a6SKrzysztof Kosiński
30*7249d1a6SKrzysztof KosińskiYAPF follows the `Google Python Style Guide
31*7249d1a6SKrzysztof Kosiński<https://google.github.io/styleguide/pyguide.html>`_ with two exceptions:
32*7249d1a6SKrzysztof Kosiński
33*7249d1a6SKrzysztof Kosiński- 2 spaces for indentation rather than 4.
34*7249d1a6SKrzysztof Kosiński- CamelCase for function and method names rather than snake_case.
35*7249d1a6SKrzysztof Kosiński
36*7249d1a6SKrzysztof KosińskiThe rationale for this is that YAPF was initially developed at Google where
37*7249d1a6SKrzysztof Kosińskithese two exceptions are still part of the internal Python style guide.
38*7249d1a6SKrzysztof Kosiński
39*7249d1a6SKrzysztof KosińskiSmall print
40*7249d1a6SKrzysztof Kosiński-----------
41*7249d1a6SKrzysztof Kosiński
42*7249d1a6SKrzysztof KosińskiContributions made by corporations are covered by a different agreement than
43*7249d1a6SKrzysztof Kosińskithe one above, the Software Grant and Corporate Contributor License Agreement.
44