|
| 1 | +# Contributing to go-struct-converter |
| 2 | + |
| 3 | +If you are looking to contribute to this project and want to open a GitHub pull request ("PR"), there are a few guidelines of what we are looking for in patches. Make sure you go through this document and ensure that your code proposal is aligned. |
| 4 | + |
| 5 | +## Sign off your work |
| 6 | + |
| 7 | +The `sign-off` is an added line at the end of the explanation for the commit, certifying that you wrote it or otherwise have the right to submit it as an open-source patch. By submitting a contribution, you agree to be bound by the terms of the DCO Version 1.1 and Apache License Version 2.0. |
| 8 | + |
| 9 | +Signing off a commit certifies the below Developer's Certificate of Origin (DCO): |
| 10 | + |
| 11 | +```text |
| 12 | +Developer's Certificate of Origin 1.1 |
| 13 | +
|
| 14 | +By making a contribution to this project, I certify that: |
| 15 | +
|
| 16 | + (a) The contribution was created in whole or in part by me and I |
| 17 | + have the right to submit it under the open source license |
| 18 | + indicated in the file; or |
| 19 | +
|
| 20 | + (b) The contribution is based upon previous work that, to the best |
| 21 | + of my knowledge, is covered under an appropriate open source |
| 22 | + license and I have the right under that license to submit that |
| 23 | + work with modifications, whether created in whole or in part |
| 24 | + by me, under the same open source license (unless I am |
| 25 | + permitted to submit under a different license), as indicated |
| 26 | + in the file; or |
| 27 | +
|
| 28 | + (c) The contribution was provided directly to me by some other |
| 29 | + person who certified (a), (b) or (c) and I have not modified |
| 30 | + it. |
| 31 | +
|
| 32 | + (d) I understand and agree that this project and the contribution |
| 33 | + are public and that a record of the contribution (including all |
| 34 | + personal information I submit with it, including my sign-off) is |
| 35 | + maintained indefinitely and may be redistributed consistent with |
| 36 | + this project or the open source license(s) involved. |
| 37 | +``` |
| 38 | + |
| 39 | +All contributions to this project are licensed under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/). |
| 40 | + |
| 41 | +When committing your change, you can add the required line manually so that it looks like this: |
| 42 | + |
| 43 | +```text |
| 44 | +Signed-off-by: John Doe <john.doe@example.com> |
| 45 | +``` |
| 46 | + |
| 47 | +Alternatively, configure your Git client with your name and email to use the `-s` flag when creating a commit: |
| 48 | + |
| 49 | +```text |
| 50 | +$ git config --global user.name "John Doe" |
| 51 | +$ git config --global user.email "john.doe@example.com" |
| 52 | +``` |
| 53 | + |
| 54 | +Creating a signed-off commit is then possible with `-s` or `--signoff`: |
| 55 | + |
| 56 | +```text |
| 57 | +$ git commit -s -m "this is a commit message" |
| 58 | +``` |
| 59 | + |
| 60 | +To double-check that the commit was signed-off, look at the log output: |
| 61 | + |
| 62 | +```text |
| 63 | +$ git log -1 |
| 64 | +commit 37ceh170e4hb283bb73d958f2036ee5k07e7fde7 (HEAD -> issue-35, origin/main, main) |
| 65 | +Author: John Doe <john.doe@example.com> |
| 66 | +Date: Mon Aug 1 11:27:13 2020 -0400 |
| 67 | +
|
| 68 | + this is a commit message |
| 69 | +
|
| 70 | + Signed-off-by: John Doe <john.doe@example.com> |
| 71 | +``` |
| 72 | + |
| 73 | +[//]: # "TODO: Commit guidelines, granular commits" |
| 74 | +[//]: # "TODO: Commit guidelines, descriptive messages" |
| 75 | +[//]: # "TODO: Commit guidelines, commit title, extra body description" |
| 76 | +[//]: # "TODO: PR title and description" |
| 77 | + |
| 78 | +## Test your changes |
| 79 | + |
| 80 | +Ensure that your changes have passed the test suite. |
| 81 | + |
| 82 | +Simply run `make test` to have all tests run and validate changes work properly. |
| 83 | + |
| 84 | +## Document your changes |
| 85 | + |
| 86 | +When proposed changes are modifying user-facing functionality or output, it is expected the PR will include updates to the documentation as well. |
0 commit comments