Skip to content

Commit c68fdcf

Browse files
authored
chore: add contributing docs (#2)
1 parent 87ae6c3 commit c68fdcf

File tree

3 files changed

+105
-2
lines changed

3 files changed

+105
-2
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
name: Test
2-
on: [push, pull_request]
2+
on:
3+
pull_request:
4+
paths:
5+
- '**'
6+
- '!**.md'
7+
- '!LICENSE'
8+
push:
9+
branches: [ main ]
10+
paths:
11+
- '**'
12+
- '!**.md'
13+
- '!LICENSE'
14+
315
jobs:
416
test:
517
runs-on: ubuntu-20.04

CONTRIBUTING.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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.

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ types. Some examples are:
2020

2121
The automatic conversions are implemented when there is an obvious way
2222
to convert between the types. A lot more automatic conversions happen
23-
-- see [the converter tests](converter_testo.go) for a more comprehensive
23+
-- see [the converter tests](converter_test.go) for a more comprehensive
2424
list of what is currently supported.
2525

2626
Not everything can be handled automatically, however, so there is also
@@ -159,3 +159,8 @@ func (to *V3) ConvertFrom(from interface{}) error {
159159
At this point we could convert in either direction, for example a
160160
`V3` struct could convert to a `V1` struct, with the caveat that there
161161
may be data loss, as might need to happen due to changes in the data shapes.
162+
163+
## Contributing
164+
165+
If you would like to contribute to this repository, please see the
166+
[CONTRIBUTING.md](CONTRIBUTING.md).

0 commit comments

Comments
 (0)