CONTRIBUTING.rst 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. Contributing code to Matrix
  2. ===========================
  3. Everyone is welcome to contribute code to Matrix
  4. (https://github.com/matrix-org), provided that they are willing to license
  5. their contributions under the same license as the project itself. We follow a
  6. simple 'inbound=outbound' model for contributions: the act of submitting an
  7. 'inbound' contribution means that the contributor agrees to license the code
  8. under the same terms as the project's overall 'outbound' license - in our
  9. case, this is almost always Apache Software License v2 (see LICENSE).
  10. How to contribute
  11. ~~~~~~~~~~~~~~~~~
  12. The preferred and easiest way to contribute changes to Matrix is to fork the
  13. relevant project on github, and then create a pull request to ask us to pull
  14. your changes into our repo
  15. (https://help.github.com/articles/using-pull-requests/)
  16. **The single biggest thing you need to know is: please base your changes on
  17. the develop branch - /not/ master.**
  18. We use the master branch to track the most recent release, so that folks who
  19. blindly clone the repo and automatically check out master get something that
  20. works. Develop is the unstable branch where all the development actually
  21. happens: the workflow is that contributors should fork the develop branch to
  22. make a 'feature' branch for a particular contribution, and then make a pull
  23. request to merge this back into the matrix.org 'official' develop branch. We
  24. use github's pull request workflow to review the contribution, and either ask
  25. you to make any refinements needed or merge it and make them ourselves. The
  26. changes will then land on master when we next do a release.
  27. We use `Jenkins <http://matrix.org/jenkins>`_ and
  28. `Travis <https://travis-ci.org/matrix-org/synapse>`_ for continuous
  29. integration. All pull requests to synapse get automatically tested by Travis;
  30. the Jenkins builds require an adminstrator to start them. If your change
  31. breaks the build, this will be shown in github, so please keep an eye on the
  32. pull request for feedback.
  33. Code style
  34. ~~~~~~~~~~
  35. All Matrix projects have a well-defined code-style - and sometimes we've even
  36. got as far as documenting it... For instance, synapse's code style doc lives
  37. at https://github.com/matrix-org/synapse/tree/master/docs/code_style.rst.
  38. Please ensure your changes match the cosmetic style of the existing project,
  39. and **never** mix cosmetic and functional changes in the same commit, as it
  40. makes it horribly hard to review otherwise.
  41. Attribution
  42. ~~~~~~~~~~~
  43. Everyone who contributes anything to Matrix is welcome to be listed in the
  44. AUTHORS.rst file for the project in question. Please feel free to include a
  45. change to AUTHORS.rst in your pull request to list yourself and a short
  46. description of the area(s) you've worked on. Also, we sometimes have swag to
  47. give away to contributors - if you feel that Matrix-branded apparel is missing
  48. from your life, please mail us your shipping address to matrix at matrix.org and we'll try to fix it :)
  49. Sign off
  50. ~~~~~~~~
  51. In order to have a concrete record that your contribution is intentional
  52. and you agree to license it under the same terms as the project's license, we've adopted the
  53. same lightweight approach that the Linux Kernel
  54. (https://www.kernel.org/doc/Documentation/SubmittingPatches), Docker
  55. (https://github.com/docker/docker/blob/master/CONTRIBUTING.md), and many other
  56. projects use: the DCO (Developer Certificate of Origin:
  57. http://developercertificate.org/). This is a simple declaration that you wrote
  58. the contribution or otherwise have the right to contribute it to Matrix::
  59. Developer Certificate of Origin
  60. Version 1.1
  61. Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
  62. 660 York Street, Suite 102,
  63. San Francisco, CA 94110 USA
  64. Everyone is permitted to copy and distribute verbatim copies of this
  65. license document, but changing it is not allowed.
  66. Developer's Certificate of Origin 1.1
  67. By making a contribution to this project, I certify that:
  68. (a) The contribution was created in whole or in part by me and I
  69. have the right to submit it under the open source license
  70. indicated in the file; or
  71. (b) The contribution is based upon previous work that, to the best
  72. of my knowledge, is covered under an appropriate open source
  73. license and I have the right under that license to submit that
  74. work with modifications, whether created in whole or in part
  75. by me, under the same open source license (unless I am
  76. permitted to submit under a different license), as indicated
  77. in the file; or
  78. (c) The contribution was provided directly to me by some other
  79. person who certified (a), (b) or (c) and I have not modified
  80. it.
  81. (d) I understand and agree that this project and the contribution
  82. are public and that a record of the contribution (including all
  83. personal information I submit with it, including my sign-off) is
  84. maintained indefinitely and may be redistributed consistent with
  85. this project or the open source license(s) involved.
  86. If you agree to this for your contribution, then all that's needed is to
  87. include the line in your commit or pull request comment::
  88. Signed-off-by: Your Name <your@email.example.org>
  89. ...using your real name; unfortunately pseudonyms and anonymous contributions
  90. can't be accepted. Git makes this trivial - just use the -s flag when you do
  91. ``git commit``, having first set ``user.name`` and ``user.email`` git configs
  92. (which you should have done anyway :)
  93. Conclusion
  94. ~~~~~~~~~~
  95. That's it! Matrix is a very open and collaborative project as you might expect given our obsession with open communication. If we're going to successfully matrix together all the fragmented communication technologies out there we are reliant on contributions and collaboration from the community to do so. So please get involved - and we hope you have as much fun hacking on Matrix as we do!