1*dc5640d1SHerbert Xue# How to contribute # 2*dc5640d1SHerbert Xue 3*dc5640d1SHerbert XueWe'd love to accept your patches and contributions to this project. There are 4*dc5640d1SHerbert Xuea just a few small guidelines you need to follow. 5*dc5640d1SHerbert Xue 6*dc5640d1SHerbert Xue 7*dc5640d1SHerbert Xue## Contributor License Agreement ## 8*dc5640d1SHerbert Xue 9*dc5640d1SHerbert XueContributions to any Google project must be accompanied by a Contributor 10*dc5640d1SHerbert XueLicense Agreement. This is not a copyright **assignment**, it simply gives 11*dc5640d1SHerbert XueGoogle permission to use and redistribute your contributions as part of the 12*dc5640d1SHerbert Xueproject. 13*dc5640d1SHerbert Xue 14*dc5640d1SHerbert Xue * If you are an individual writing original source code and you're sure you 15*dc5640d1SHerbert Xue own the intellectual property, then you'll need to sign an [individual 16*dc5640d1SHerbert Xue CLA][]. 17*dc5640d1SHerbert Xue 18*dc5640d1SHerbert Xue * If you work for a company that wants to allow you to contribute your work, 19*dc5640d1SHerbert Xue then you'll need to sign a [corporate CLA][]. 20*dc5640d1SHerbert Xue 21*dc5640d1SHerbert XueYou generally only need to submit a CLA once, so if you've already submitted 22*dc5640d1SHerbert Xueone (even if it was for a different project), you probably don't need to do it 23*dc5640d1SHerbert Xueagain. 24*dc5640d1SHerbert Xue 25*dc5640d1SHerbert Xue[individual CLA]: https://developers.google.com/open-source/cla/individual 26*dc5640d1SHerbert Xue[corporate CLA]: https://developers.google.com/open-source/cla/corporate 27*dc5640d1SHerbert Xue 28*dc5640d1SHerbert Xue 29*dc5640d1SHerbert Xue## Submitting a patch ## 30*dc5640d1SHerbert Xue 31*dc5640d1SHerbert Xue 1. It's generally best to start by opening a new issue describing the bug or 32*dc5640d1SHerbert Xue feature you're intending to fix. Even if you think it's relatively minor, 33*dc5640d1SHerbert Xue it's helpful to know what people are working on. Mention in the initial 34*dc5640d1SHerbert Xue issue that you are planning to work on that bug or feature so that it can 35*dc5640d1SHerbert Xue be assigned to you. 36*dc5640d1SHerbert Xue 37*dc5640d1SHerbert Xue 1. Follow the normal process of [forking][] the project, and setup a new 38*dc5640d1SHerbert Xue branch to work in. It's important that each group of changes be done in 39*dc5640d1SHerbert Xue separate branches in order to ensure that a pull request only includes the 40*dc5640d1SHerbert Xue commits related to that bug or feature. 41*dc5640d1SHerbert Xue 42*dc5640d1SHerbert Xue 1. Any significant changes should almost always be accompanied by tests. The 43*dc5640d1SHerbert Xue project already has good test coverage, so look at some of the existing 44*dc5640d1SHerbert Xue tests if you're unsure how to go about it. 45*dc5640d1SHerbert Xue 46*dc5640d1SHerbert Xue 1. All contributions must be licensed Apache 2.0 and all files must have 47*dc5640d1SHerbert Xue a copy of the boilerplate licence comment (can be copied from an existing 48*dc5640d1SHerbert Xue file. Files should be formatted according to Google's [java style guide][]. 49*dc5640d1SHerbert Xue 50*dc5640d1SHerbert Xue 1. Do your best to have [well-formed commit messages][] for each change. 51*dc5640d1SHerbert Xue This provides consistency throughout the project, and ensures that commit 52*dc5640d1SHerbert Xue messages are able to be formatted properly by various git tools. 53*dc5640d1SHerbert Xue 54*dc5640d1SHerbert Xue 1. Finally, push the commits to your fork and submit a [pull request][]. 55*dc5640d1SHerbert Xue 56*dc5640d1SHerbert Xue[forking]: https://help.github.com/articles/fork-a-repo 57*dc5640d1SHerbert Xue[java style guide]: https://google.github.io/styleguide/javaguide.html 58*dc5640d1SHerbert Xue[well-formed commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html 59*dc5640d1SHerbert Xue[pull request]: https://help.github.com/articles/creating-a-pull-request 60*dc5640d1SHerbert Xue 61*dc5640d1SHerbert Xue 62