You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

94 line
3.3 KiB

  1. Contributing to rebar
  2. ---------------------
  3. Before implementing a new feature, please submit a ticket to discuss your plans.
  4. The feature might have been rejected already, or the implementation might already be decided.
  5. See [Community and Resources](README.md#community-and-resources).
  6. Code style
  7. ----------
  8. The following rules must be followed:
  9. * Do not introduce trailing whitespace
  10. * Do not mix spaces and tabs
  11. * Do not introduce lines longer than 80 characters
  12. The following rules should be followed:
  13. * Write small functions whenever possible
  14. * Avoid having too many clauses containing clauses containing clauses.
  15. Basically, avoid deeply nested functions.
  16. [erlang-mode (emacs)](http://www.erlang.org/doc/man/erlang.el.html)
  17. indentation is preferred. This will keep the code base consistent.
  18. vi users are encouraged to give [Vim emulation](http://emacswiki.org/emacs/Evil) ([more
  19. info](https://gitorious.org/evil/pages/Home)) a try.
  20. Pull requests and branching
  21. ---------------------------
  22. Use one topic branch per pull request. If you do that, you can add extra commits or fix up
  23. buggy commits via `git rebase -i`, and update the branch. The updated branch will be
  24. visible in the same pull request. Therefore, you should not open a new pull request when
  25. you have to fix your changes.
  26. Do not commit to master in your fork.
  27. Provide a clean branch without merge commits.
  28. Committing your changes
  29. -----------------------
  30. Please ensure that all commits pass all tests, and do not have extra Dialyzer warnings.
  31. To do that run `make check`. If you didn't build via `make debug` at first, the beam files in
  32. `ebin/` might be missing debug_info required for [xref](http://www.erlang.org/doc/man/xref.html)
  33. and [Dialyzer](http://www.erlang.org/doc/man/dialyzer.html), causing a test
  34. failure.
  35. If that happens, running `make clean` before running `make check` could solve the problem.
  36. If you change any of the files with known but safe to ignore Dialyzer warnings, you may
  37. have to adapt the line number(s) in [dialyzer_reference](dialyzer_reference). If you do that,
  38. do not remove the
  39. leading blank line.
  40. #### Structuring your commits
  41. Fixing a bug is one commit.
  42. Adding a feature is one commit.
  43. Adding two features is two commits.
  44. Two unrelated changes is two commits.
  45. If you fix a (buggy) commit, squash (`git rebase -i`) the changes as a fixup commit into
  46. the original commit.
  47. #### Writing Commit Messages
  48. It's important to write a proper commit title and description. The commit title must be
  49. at most 50 characters; it is the first line of the commit text. The second line of the
  50. commit text must be left blank. The third line and beyond is the commit message. You
  51. should write a commit message. If you do, wrap all lines at 72 characters. You should
  52. explain what the commit does, what references you used, and any other information
  53. that helps understanding your changes.
  54. Basically, structure your commit message like this:
  55. <pre>
  56. One line summary (at most 50 characters)
  57. Longer description (wrap at 72 characters)
  58. </pre>
  59. ##### Commit title/summary
  60. * At most 50 characters
  61. * What was changed
  62. * Imperative present tense (Fix, Add, Change)
  63. * `Fix bug 123`
  64. * `Add 'foobar' command`
  65. * `Change default timeout to 123`
  66. * No period
  67. ##### Commit description
  68. * Wrap at 72 characters
  69. * Why, explain intention and implementation approach
  70. * Present tense