xref: /aosp_15_r20/external/open-dice/docs/contributing.md (revision 60b67249c2e226f42f35cc6cfe66c6048e0bae6b)
1# Contributing
2
3We'd love to accept your patches and contributions to this project. There are
4just a few small guidelines you need to follow.
5
6## Contributor License Agreement
7
8Contributions to this project must be accompanied by a Contributor License
9Agreement. You (or your employer) retain the copyright to your contribution;
10this simply gives us permission to use and redistribute your contributions as
11part of the project. Head over to <https://cla.developers.google.com/> to see
12your current agreements on file or to sign a new one.
13
14You generally only need to submit a CLA once, so if you've already submitted one
15(even if it was for a different project), you probably don't need to do it
16again.
17
18## Code Reviews
19
20All submissions, including submissions by project members, require review. We
21use Gerrit for this purpose, we do not currently support GitHub pull requests.
22
23See the
24[Gerrit walkthrough](https://gerrit-review.googlesource.com/Documentation/intro-gerrit-walkthrough.html),
25[Gerrit user guide](https://gerrit-review.googlesource.com/Documentation/intro-user.html)
26and other
27[Gerrit documentation](https://gerrit-review.googlesource.com/Documentation/index.html)
28for more information. GitHub users may find the
29[walkthrough for GitHub users](https://gerrit-review.googlesource.com/Documentation/intro-gerrit-walkthrough-github.html)
30helpful.
31
32### Gerrit Commit Hook
33
34Set up the
35[Gerrit commit hook](https://gerrit-review.googlesource.com/tools/hooks/commit-msg)
36to automatically add a `Change-Id` tag to each commit. On Linux you can run:
37
38```bash
39$ f=`git rev-parse --git-dir`/hooks/commit-msg ; mkdir -p $(dirname $f) ; curl -Lo $f https://gerrit-review.googlesource.com/tools/hooks/commit-msg ; chmod +x $f
40```
41
42## Community Guidelines
43
44This project follows
45[Google's Open Source Community Guidelines](https://opensource.google/conduct/).
46
47## Source Code Headers
48
49Every file containing source code must include copyright and license
50information.
51
52Apache header for C and C++ files:
53
54```javascript
55// Copyright 2020 Google LLC
56//
57// Licensed under the Apache License, Version 2.0 (the "License"); you may not
58// use this file except in compliance with the License. You may obtain a copy of
59// the License at
60//
61//     https://www.apache.org/licenses/LICENSE-2.0
62//
63// Unless required by applicable law or agreed to in writing, software
64// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
65// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
66// License for the specific language governing permissions and limitations under
67// the License.
68```
69
70Apache header for Python and GN files:
71
72```python
73# Copyright 2020 Google LLC
74#
75# Licensed under the Apache License, Version 2.0 (the "License"); you may not
76# use this file except in compliance with the License. You may obtain a copy of
77# the License at
78#
79#     https://www.apache.org/licenses/LICENSE-2.0
80#
81# Unless required by applicable law or agreed to in writing, software
82# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
83# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
84# License for the specific language governing permissions and limitations under
85# the License.
86```
87