xref: /aosp_15_r20/external/spdx-tools/CONTRIBUTING.md (revision ba677afa8f67bb56cbc794f4d0e378e0da058e16)
1SPDX-License-Identifier: CC-BY-4.0
2
3# Contributing
4
5All contributions must include a "Signed-off-by" line in the commit message.
6
7This indicates that the contribution is made pursuant to the [Developer Certificate of Origin (DCO)](https://developercertificate.org/), a copy of which is included below.
8
9## Test coverage
10
11Since this library is intended to be relied upon by other tools to work with SPDX data, we are aiming to ensure that it is and remains well-tested.
12
13PRs with new code should include corresponding test files, and should continue to pass existing tests. Unit tests for `foo.go` should be placed in `foo_test.go`. Test data files and folders should be placed in the top-level `testdata/` folder.
14
15To run the test suite, from the top-level directory run: `go test ./...`
16
17## License information
18
19New **code files** should include a [short-form SPDX ID](https://spdx.org/ids) at the top, indicating the project license for code, which is Apache-2.0 OR GPL-2.0-or-later. This should look like the following:
20
21```
22// SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
23```
24
25New **documentation files** should include a [short-form SPDX ID](https://spdx.org/ids) at the top, indicating the project license for documentation, which is CC-BY-4.0. This should look like the following:
26
27```
28SPDX-License-Identifier: CC-BY-4.0
29```
30
31## Developer Certificate of Origin (DCO)
32
33```
34Developer Certificate of Origin
35Version 1.1
36
37Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
381 Letterman Drive
39Suite D4700
40San Francisco, CA, 94129
41
42Everyone is permitted to copy and distribute verbatim copies of this
43license document, but changing it is not allowed.
44
45
46Developer's Certificate of Origin 1.1
47
48By making a contribution to this project, I certify that:
49
50(a) The contribution was created in whole or in part by me and I
51    have the right to submit it under the open source license
52    indicated in the file; or
53
54(b) The contribution is based upon previous work that, to the best
55    of my knowledge, is covered under an appropriate open source
56    license and I have the right under that license to submit that
57    work with modifications, whether created in whole or in part
58    by me, under the same open source license (unless I am
59    permitted to submit under a different license), as indicated
60    in the file; or
61
62(c) The contribution was provided directly to me by some other
63    person who certified (a), (b) or (c) and I have not modified
64    it.
65
66(d) I understand and agree that this project and the contribution
67    are public and that a record of the contribution (including all
68    personal information I submit with it, including my sign-off) is
69    maintained indefinitely and may be redistributed consistent with
70    this project or the open source license(s) involved.
71```
72