11## Contribution Guidelines
22
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 a seasoned go developer on github, then you should just feel at home with us and you may skip
8+ > the rest of this document. This is just the usual guideline for a go library project on github.
9+
10+ These guidelines are general to all libraries published on github by the ` go-openapi ` organization.
11+
12+ You'll find more detailed (or repo-specific) instructions in the [ maintainer's docs] ( ../docs ) .
13+
14+ ### Asking questions
15+
16+ You may inquire about anything by reporting a "Question" issue on github.
17+
18+ ### Reporting issues
19+
20+ Reporting a problem with our libraries _ is_ a valuable contribution.
21+
22+ You can do this on the github issues page of this repository.
23+
24+ Please be as specific as possible when describing your issue.
25+
26+ Whenever relevant, please provide information about your environment (go version, OS).
27+
28+ Adding a code snippet to reproduce the issue is great, and as a big time saver for maintainers.
29+
330### Pull requests are always welcome
431
5- We are always thrilled to receive pull requests, and do our best to
6- process them as fast as possible. Not sure if that typo is worth a pull
7- request? Do it! We will appreciate it.
32+ We are always thrilled to receive pull requests, and we do our best to
33+ process them as fast as possible.
34+
35+ Not sure if that typo is worth a pull request? Do it! We will appreciate it.
36+
37+ If your pull request is not accepted on the first try, don't be discouraged!
38+ If there's a problem with the implementation, hopefully you received feedback on what to improve.
839
9- If your pull request is not accepted on the first try, don't be
10- discouraged! If there's a problem with the implementation, hopefully you
11- received feedback on what to improve .
40+ We're trying very hard to keep the go-openapi packages lean and focused.
41+ These packages constitute a toolkit: it won't do everything for everybody out of the box,
42+ but everybody can use it to do just about everything related to OpenAPI .
1243
13- We're trying very hard to keep go-swagger lean and focused. We don't want it
14- to do everything for everybody. This means that we might decide against
15- incorporating a new feature. However, there might be a way to implement
16- that feature * on top of* go-swagger.
44+ This means that we might decide against incorporating a new feature.
1745
46+ However, there might be a way to implement that feature * on top of* our libraries.
47+
48+ ### Environment
49+
50+ You just need a ` go ` compiler to be installed. No special tools are needed to work with our libraries.
51+
52+ The go compiler version required is always the old stable (latest minor go version - 1).
53+
54+ If you're already used to work with ` go ` you should already have everything in place.
55+
56+ Although not required, you'll be certainly more productive with a local installation of ` golangci-lint ` ,
57+ the meta-linter our CI uses.
58+
59+ If you don't have it, you may instal it like so:
60+
61+ ``` sh
62+ go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
63+ ```
1864
1965### Conventions
2066
21- Fork the repo and make changes on your fork in a feature branch:
67+ #### Git flow
68+
69+ Fork the repo and make changes to your fork in a feature branch.
70+
71+ To submit a pull request, push your branch to your fork (e.g. ` upstream ` remote):
72+ github will propose to open a pull request on the original repository.
73+
74+ Typically you'd follow some common naming conventions:
75+
76+ - if it's a bugfix branch, name it ` fix/XXX-something ` where XXX is the number of the
77+ issue on github
78+ - if it's a feature branch, create an enhancement issue to announce your
79+ intentions, and name it ` feature/XXX-something ` where XXX is the number of the issue.
80+
81+ > NOTE: we don't enforce naming conventions on branches: it's your fork after all.
82+
83+ #### Tests
2284
23- - If it's a bugfix branch, name it XXX-something where XXX is the number of the
24- issue
25- - If it's a feature branch, create an enhancement issue to announce your
26- intentions, and name it XXX-something where XXX is the number of the issue.
85+ Submit unit tests for your changes.
2786
28- Submit unit tests for your changes. Go has a great test framework built in; use
29- it! Take a look at existing tests for inspiration. Run the full test suite on
30- your branch before submitting a pull request.
87+ Go has a great built-in test framework ; use it!
3188
32- Update the documentation when creating or modifying features. Test
33- your documentation changes for clarity, concision, and correctness, as
34- well as a clean documentation build. See `` docs/README.md `` for more
35- information on building the docs and how docs get released.
89+ Take a look at existing tests for inspiration, and run the full test suite on your branch
90+ before submitting a pull request.
3691
37- Write clean code. Universally formatted code promotes ease of writing, reading,
38- and maintenance. Always run ` gofmt -s -w file.go ` on each changed file before
39- committing your changes. Most editors have plugins that do this automatically.
92+ #### Code style
93+
94+ You may read our stance on code style [ there] ( ../docs/STYLE.md ) .
95+
96+ #### Documentation
97+
98+ Update the documentation when creating or modifying features.
99+
100+ The documentation for the go-openapi packages is found on the public go docs site:
101+
102+ < https://pkg.go.dev/github.com/go-openapi/jsonpointer >
103+
104+ Test your documentation changes for clarity, concision, and correctness, as
105+ well as a clean documentation build.
106+
107+ If you want to assess the rendering of your changes when published to ` pkg.go.dev ` , you may
108+ want to install the ` pkgsite ` tool proposed by ` golang.org ` .
109+
110+ ``` sh
111+ go install golang.org/x/pkgsite/cmd/pkgsite@latest
112+ ```
113+
114+ Then run on the repository folder:
115+ ``` sh
116+ pkgsite .
117+ ```
118+
119+ This wil run a godoc server locally where you may see the documentation generated from your local repository.
120+
121+ #### Commit messages
40122
41123Pull requests descriptions should be as clear as possible and include a
42124reference to all the issues that they address.
@@ -47,26 +129,32 @@ Commit messages must start with a capitalized and short summary (max. 50
47129chars) written in the imperative, followed by an optional, more detailed
48130explanatory text which is separated from the summary by an empty line.
49131
132+ Commits that fix or close an issue should include a reference like ` Closes #XXX `
133+ or ` Fixes #XXX ` , which will automatically close the issue when merged.
134+
135+ #### Code review
136+
50137Code review comments may be added to your pull request. Discuss, then make the
51138suggested modifications and push additional commits to your feature branch. Be
52139sure to post a comment after pushing. The new commits will show up in the pull
53140request automatically, but the reviewers will not be notified unless you
54141comment.
55142
56- Before the pull request is merged, make sure that you squash your commits into
57- logical units of work using ` git rebase -i ` and ` git push -f ` . After every
58- commit the test suite should be passing. Include documentation changes in the
59- same commit so that a revert would remove all traces of the feature or fix.
143+ Before the pull request is merged,
144+ ** make sure that you squash your commits into logical units of work**
145+ using ` git rebase -i ` and ` git push -f ` .
60146
61- Commits that fix or close an issue should include a reference like ` Closes #XXX `
62- or ` Fixes #XXX ` , which will automatically close the issue when merged.
147+ After every commit the test suite should be passing.
148+
149+ Include documentation changes in the same commit so that a revert would remove all traces of the feature or fix.
63150
64151### Sign your work
65152
66- The sign-off is a simple line at the end of the explanation for the
67- patch, which certifies that you wrote it or otherwise have the right to
68- pass it on as an open-source patch. The rules are pretty simple: if you
69- can certify the below (from
153+ The sign-off is a simple line at the end of your commit message,
154+ which certifies that you wrote it or otherwise have the right to
155+ pass it on as an open-source patch.
156+
157+ The rules are pretty simple: if you can certify the below (from
70158[ developercertificate.org] ( http://developercertificate.org/ ) ):
71159
72160```
@@ -115,3 +203,18 @@ then you just add a line to every git commit message:
115203using your real name (sorry, no pseudonyms or anonymous contributions.)
116204
117205You can add the sign off when creating the git commit via ` git commit -s ` .
206+
207+ > Notice that at this moment, we do not require commits to be PGP-signed.
208+
209+ ## Issue Triage [ ![ Open Source Helpers] ( https://www.codetriage.com/go-swagger/go-swagger/badges/users.svg )] ( https://www.codetriage.com/go-swagger/go-swagger )
210+
211+ You can help triage issues which may include:
212+
213+ * reproducing bug reports
214+ * asking for important information, such as version numbers or reproduction instructions
215+ * answering questions and sharing your insight in issue comments
216+
217+ If you would like to start triaging issues, one easy way to get started is to
218+ [ subscribe to go-swagger on CodeTriage] ( https://www.codetriage.com/go-swagger/go-swagger ) .
219+
220+ > Disclaimer: the go-swagger maintainers have no affiliation with ` www.codetriage.com ` .
0 commit comments