|
1 | 1 | ## Contribution Guidelines |
2 | 2 |
|
3 | | -You'll find below general guidelines, which mostly correspond to standard practices for open sourced repositories. |
4 | | - |
5 | | ->**TL;DR** |
6 | | -> |
7 | | -> If you're already an experienced go developer on github, then you should just feel at home with us |
8 | | -> and you may well skip the rest of this document. |
9 | | -> |
10 | | -> You'll essentially find the usual guideline for a go library project on github. |
11 | | -
|
12 | | -These guidelines are general to all libraries published on github by the `go-openapi` organization. |
13 | | - |
14 | | -You'll find more detailed (or repo-specific) instructions in the [maintainer's docs](../docs). |
15 | | - |
16 | | -## How can I contribute? |
17 | | - |
18 | | -There are many ways in which you can contribute. Here are a few ideas: |
19 | | - |
20 | | - * Reporting Issues / Bugs |
21 | | - * Suggesting Improvements |
22 | | - * Code |
23 | | - * bug fixes and new features that are within the main project scope |
24 | | - * improving test coverage |
25 | | - * addressing code quality issues |
26 | | - * Documentation |
27 | | - * Art work that makes the project look great |
28 | | - |
29 | | -## Questions & issues |
30 | | - |
31 | | -### Asking questions |
32 | | - |
33 | | -You may inquire about anything about this library by reporting a "Question" issue on github. |
34 | | - |
35 | | -### Reporting issues |
36 | | - |
37 | | -Reporting a problem with our libraries _is_ a valuable contribution. |
38 | | - |
39 | | -You can do this on the github issues page of this repository. |
40 | | - |
41 | | -Please be as specific as possible when describing your issue. |
42 | | - |
43 | | -Whenever relevant, please provide information about your environment (go version, OS). |
44 | | - |
45 | | -Adding a code snippet to reproduce the issue is great, and as a big time saver for maintainers. |
46 | | - |
47 | | -### Triaging issues |
48 | | - |
49 | | -You can help triage issues which may include: |
50 | | - |
51 | | -* reproducing bug reports |
52 | | -* asking for important information, such as version numbers or reproduction instructions |
53 | | -* answering questions and sharing your insight in issue comments |
54 | | - |
55 | | -## Code contributions |
56 | | - |
57 | | -### Pull requests are always welcome |
58 | | - |
59 | | -We are always thrilled to receive pull requests, and we do our best to |
60 | | -process them as fast as possible. |
61 | | - |
62 | | -Not sure if that typo is worth a pull request? Do it! We will appreciate it. |
63 | | - |
64 | | -If your pull request is not accepted on the first try, don't be discouraged! |
65 | | -If there's a problem with the implementation, hopefully you received feedback on what to improve. |
66 | | - |
67 | | -If you have a lot of ideas or a lot of issues to solve, try to refrain a bit and post focused |
68 | | -pull requests. |
69 | | -Think that they must be reviewed by a maintainer and it is easy to lost track of things on big PRs. |
70 | | - |
71 | | -We're trying very hard to keep the go-openapi packages lean and focused. |
72 | | -These packages constitute a toolkit: it won't do everything for everybody out of the box, |
73 | | -but everybody can use it to do just about everything related to OpenAPI. |
74 | | - |
75 | | -This means that we might decide against incorporating a new feature. |
76 | | - |
77 | | -However, there might be a way to implement that feature *on top of* our libraries. |
78 | | - |
79 | | -### Environment |
80 | | - |
81 | | -You just need a `go` compiler to be installed. No special tools are needed to work with our libraries. |
82 | | - |
83 | | -The go compiler version required is always the old stable (latest minor go version - 1). |
84 | | - |
85 | | -If you're already used to work with `go` you should already have everything in place. |
86 | | - |
87 | | -Although not required, you'll be certainly more productive with a local installation of `golangci-lint`, |
88 | | -the meta-linter our CI uses. |
89 | | - |
90 | | -If you don't have it, you may install it like so: |
91 | | - |
92 | | -```sh |
93 | | -go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest |
94 | | -``` |
95 | | - |
96 | | -### Conventions |
97 | | - |
98 | | -#### Git flow |
99 | | - |
100 | | -Fork the repo and make changes to your fork in a feature branch. |
101 | | - |
102 | | -To submit a pull request, push your branch to your fork (e.g. `upstream` remote): |
103 | | -github will propose to open a pull request on the original repository. |
104 | | - |
105 | | -Typically you'd follow some common naming conventions: |
106 | | - |
107 | | -- if it's a bugfix branch, name it `fix/XXX-something`where XXX is the number of the |
108 | | - issue on github |
109 | | -- if it's a feature branch, create an enhancement issue to announce your |
110 | | - intentions, and name it `feature/XXX-something` where XXX is the number of the issue. |
111 | | - |
112 | | -> NOTE: we don't enforce naming conventions on branches: it's your fork after all. |
113 | | -
|
114 | | -#### Tests |
115 | | - |
116 | | -Submit unit tests for your changes. |
117 | | - |
118 | | -Go has a great built-in test framework ; use it! |
119 | | - |
120 | | -Take a look at existing tests for inspiration, and run the full test suite on your branch |
121 | | -before submitting a pull request. |
122 | | - |
123 | | -Our CI measures test coverage and the test coverage of every patch. |
124 | | -Although not a blocking step - because there are so many special cases - |
125 | | -this is an indicator that maintainers consider when approving a PR. |
126 | | - |
127 | | -Please try your best to cover about 80% of your patch. |
128 | | - |
129 | | -#### Code style |
130 | | - |
131 | | -You may read our stance on code style [there](../docs/STYLE.md). |
132 | | - |
133 | | -#### Documentation |
134 | | - |
135 | | -Don't forget to update the documentation when creating or modifying features. |
136 | | - |
137 | | -Most documentation for this library is directly found in code as comments for godoc. |
138 | | - |
139 | | -The documentation for the go-openapi packages is published on the public go docs site: |
140 | | - |
141 | | -<https://pkg.go.dev/github.com/go-openapi/testify> |
142 | | - |
143 | | -Check your documentation changes for clarity, concision, and correctness. |
144 | | - |
145 | | -If you want to assess the rendering of your changes when published to `pkg.go.dev`, you may |
146 | | -want to install the `pkgsite` tool proposed by `golang.org`. |
147 | | - |
148 | | -```sh |
149 | | -go install golang.org/x/pkgsite/cmd/pkgsite@latest |
150 | | -``` |
151 | | - |
152 | | -Then run on the repository folder: |
153 | | -```sh |
154 | | -pkgsite . |
155 | | -``` |
156 | | - |
157 | | -This wil run a godoc server locally where you may see the documentation generated from your local repository. |
158 | | - |
159 | | -#### Commit messages |
160 | | - |
161 | | -Pull requests descriptions should be as clear as possible and include a |
162 | | -reference to all the issues that they address. |
163 | | - |
164 | | -Pull requests must not contain commits from other users or branches. |
165 | | - |
166 | | -Commit messages are not required to follow the "conventional commit" rule, but it's certainly a good |
167 | | -thing to follow this guidelinea (e.g. "fix: blah blah", "ci: did this", "feat: did that" ...). |
168 | | - |
169 | | -The title in your commit message is used directly to produce our release notes: try to keep them neat. |
170 | | - |
171 | | -The commit message body should detail your changes. |
172 | | - |
173 | | -If an issue should be closed by a commit, please add this reference in the commit body: |
174 | | - |
175 | | -``` |
176 | | -* fixes #{issue number} |
177 | | -``` |
178 | | - |
179 | | -#### Code review |
180 | | - |
181 | | -Code review comments may be added to your pull request. |
182 | | - |
183 | | -Discuss, then make the suggested modifications and push additional commits to your feature branch. |
184 | | - |
185 | | -Be sure to post a comment after pushing. The new commits will show up in the pull |
186 | | -request automatically, but the reviewers will not be notified unless you comment. |
187 | | - |
188 | | -Before the pull request is merged, |
189 | | -**make sure that you squash your commits into logical units of work** |
190 | | -using `git rebase -i` and `git push -f`. |
191 | | - |
192 | | -After every commit the test suite should be passing. |
193 | | - |
194 | | -Include documentation changes in the same commit so that a revert would remove all traces of the feature or fix. |
195 | | - |
196 | | -#### Sign your work |
197 | | - |
198 | | -The sign-off is a simple line at the end of your commit message, |
199 | | -which certifies that you wrote it or otherwise have the right to |
200 | | -pass it on as an open-source patch. |
201 | | - |
202 | | -We require the simple DCO below with an email signing your commit. |
203 | | -PGP-signed commit are greatly appreciated but not required. |
204 | | - |
205 | | -The rules are pretty simple: |
206 | | - |
207 | | -* read our [DCO](./DCO.md) (from [developercertificate.org](http://developercertificate.org/)) |
208 | | -* if you agree with these terms, then you just add a line to every git commit message |
209 | | - |
210 | | - Signed-off-by: Joe Smith <joe@gmail.com> |
211 | | - |
212 | | -using your real name (sorry, no pseudonyms or anonymous contributions.) |
213 | | - |
214 | | -You can add the sign off when creating the git commit via `git commit -s`. |
| 3 | +This document has moved there: <https://go-openapi.github.io/testify/project/contributing/> |
0 commit comments