| 1 |
# Contributing |
| 2 |
|
| 3 |
We'd love your help making zap the very best structured logging library in Go! |
| 4 |
|
| 5 |
If you'd like to add new exported APIs, please [open an issue][open-issue] |
| 6 |
describing your proposal — discussing API changes ahead of time makes |
| 7 |
pull request review much smoother. In your issue, pull request, and any other |
| 8 |
communications, please remember to treat your fellow contributors with |
| 9 |
respect! We take our [code of conduct](CODE_OF_CONDUCT.md) seriously. |
| 10 |
|
| 11 |
Note that you'll need to sign [Uber's Contributor License Agreement][cla] |
| 12 |
before we can accept any of your contributions. If necessary, a bot will remind |
| 13 |
you to accept the CLA when you open your pull request. |
| 14 |
|
| 15 |
## Setup |
| 16 |
|
| 17 |
[Fork][fork], then clone the repository: |
| 18 |
|
| 19 |
```bash |
| 20 |
mkdir -p $GOPATH/src/go.uber.org |
| 21 |
cd $GOPATH/src/go.uber.org |
| 22 |
git clone [email protected]:your_github_username/zap.git |
| 23 |
cd zap |
| 24 |
git remote add upstream https://github.com/uber-go/zap.git |
| 25 |
git fetch upstream |
| 26 |
``` |
| 27 |
|
| 28 |
Make sure that the tests and the linters pass: |
| 29 |
|
| 30 |
```bash |
| 31 |
make test |
| 32 |
make lint |
| 33 |
``` |
| 34 |
|
| 35 |
## Making Changes |
| 36 |
|
| 37 |
Start by creating a new branch for your changes: |
| 38 |
|
| 39 |
```bash |
| 40 |
cd $GOPATH/src/go.uber.org/zap |
| 41 |
git checkout master |
| 42 |
git fetch upstream |
| 43 |
git rebase upstream/master |
| 44 |
git checkout -b cool_new_feature |
| 45 |
``` |
| 46 |
|
| 47 |
Make your changes, then ensure that `make lint` and `make test` still pass. If |
| 48 |
you're satisfied with your changes, push them to your fork. |
| 49 |
|
| 50 |
```bash |
| 51 |
git push origin cool_new_feature |
| 52 |
``` |
| 53 |
|
| 54 |
Then use the GitHub UI to open a pull request. |
| 55 |
|
| 56 |
At this point, you're waiting on us to review your changes. We _try_ to respond |
| 57 |
to issues and pull requests within a few business days, and we may suggest some |
| 58 |
improvements or alternatives. Once your changes are approved, one of the |
| 59 |
project maintainers will merge them. |
| 60 |
|
| 61 |
We're much more likely to approve your changes if you: |
| 62 |
|
| 63 |
- Add tests for new functionality. |
| 64 |
- Write a [good commit message][commit-message]. |
| 65 |
- Maintain backward compatibility. |
| 66 |
|
| 67 |
[fork]: https://github.com/uber-go/zap/fork |
| 68 |
[open-issue]: https://github.com/uber-go/zap/issues/new |
| 69 |
[cla]: https://cla-assistant.io/uber-go/zap |
| 70 |
[commit-message]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html |