contributing.rst 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. Contributing to Docker
  2. ======================
  3. Want to hack on Docker? Awesome! There are instructions to get you
  4. started on the website: http://docker.io/gettingstarted.html
  5. They are probably not perfect, please let us know if anything feels
  6. wrong or incomplete.
  7. Contribution guidelines
  8. -----------------------
  9. Pull requests are always welcome
  10. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  11. We are always thrilled to receive pull requests, and do our best to
  12. process them as fast as possible. Not sure if that typo is worth a pull
  13. request? Do it! We will appreciate it.
  14. If your pull request is not accepted on the first try, don't be
  15. discouraged! If there's a problem with the implementation, hopefully you
  16. received feedback on what to improve.
  17. We're trying very hard to keep Docker lean and focused. We don't want it
  18. to do everything for everybody. This means that we might decide against
  19. incorporating a new feature. However, there might be a way to implement
  20. that feature *on top of* docker.
  21. Discuss your design on the mailing list
  22. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  23. We recommend discussing your plans `on the mailing
  24. list <https://groups.google.com/forum/?fromgroups#!forum/docker-club>`__
  25. before starting to code - especially for more ambitious contributions.
  26. This gives other contributors a chance to point you in the right
  27. direction, give feedback on your design, and maybe point out if someone
  28. else is working on the same thing.
  29. Create issues...
  30. ~~~~~~~~~~~~~~~~
  31. Any significant improvement should be documented as `a github
  32. issue <https://github.com/dotcloud/docker/issues>`__ before anybody
  33. starts working on it.
  34. ...but check for existing issues first!
  35. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  36. Please take a moment to check that an issue doesn't already exist
  37. documenting your bug report or improvement proposal. If it does, it
  38. never hurts to add a quick "+1" or "I have this problem too". This will
  39. help prioritize the most common problems and requests.
  40. Conventions
  41. ~~~~~~~~~~~
  42. Fork the repo and make changes on your fork in a feature branch:
  43. - If it's a bugfix branch, name it XXX-something where XXX is the number of the
  44. issue
  45. - If it's a feature branch, create an enhancement issue to announce your
  46. intentions, and name it XXX-something where XXX is the number of the issue.
  47. Submit unit tests for your changes. Go has a great test framework built in; use
  48. it! Take a look at existing tests for inspiration. Run the full test suite on
  49. your branch before submitting a pull request.
  50. Make sure you include relevant updates or additions to documentation when
  51. creating or modifying features.
  52. Write clean code. Universally formatted code promotes ease of writing, reading,
  53. and maintenance. Always run ``go fmt`` before committing your changes. Most
  54. editors have plugins that do this automatically, and there's also a git
  55. pre-commit hook:
  56. .. code-block:: bash
  57. curl -o .git/hooks/pre-commit https://raw.github.com/edsrzf/gofmt-git-hook/master/fmt-check && chmod +x .git/hooks/pre-commit
  58. Pull requests descriptions should be as clear as possible and include a
  59. reference to all the issues that they address.
  60. Code review comments may be added to your pull request. Discuss, then make the
  61. suggested modifications and push additional commits to your feature branch. Be
  62. sure to post a comment after pushing. The new commits will show up in the pull
  63. request automatically, but the reviewers will not be notified unless you
  64. comment.
  65. Before the pull request is merged, make sure that you squash your commits into
  66. logical units of work using ``git rebase -i`` and ``git push -f``. After every
  67. commit the test suite should be passing. Include documentation changes in the
  68. same commit so that a revert would remove all traces of the feature or fix.
  69. Commits that fix or close an issue should include a reference like ``Closes #XXX``
  70. or ``Fixes #XXX``, which will automatically close the issue when merged.
  71. Add your name to the AUTHORS file, but make sure the list is sorted and your
  72. name and email address match your git configuration. The AUTHORS file is
  73. regenerated occasionally from the git commit history, so a mismatch may result
  74. in your changes being overwritten.