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