25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

104 lines
3.2 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. Tests
  29. -----
  30. As a general rule, any behavioral change to rebar requires a test to go with it. If there's
  31. already a test case, you may have to modify that one. If there isn't a test case or a test
  32. suite, add a new test case or suite in `test/`.
  33. ```sh
  34. $ ./bootstrap
  35. $ ./rebar3 ct
  36. ```
  37. Credit
  38. ------
  39. To give everyone proper credit in addition to the git history, please feel free to append
  40. your name to `THANKS` in your first contribution.
  41. Committing your changes
  42. -----------------------
  43. Please ensure that all commits pass all tests, and do not have extra Dialyzer warnings.
  44. To do that run `./rebar3 ct` and `./rebar3 as dialyze dialyzer`.
  45. #### Structuring your commits
  46. Fixing a bug is one commit.
  47. Adding a feature is one commit.
  48. Adding two features is two commits.
  49. Two unrelated changes is two commits.
  50. If you fix a (buggy) commit, squash (`git rebase -i`) the changes as a fixup commit into
  51. the original commit.
  52. #### Writing Commit Messages
  53. It's important to write a proper commit title and description. The commit title must be
  54. at most 50 characters; it is the first line of the commit text. The second line of the
  55. commit text must be left blank. The third line and beyond is the commit message. You
  56. should write a commit message. If you do, wrap all lines at 72 characters. You should
  57. explain what the commit does, what references you used, and any other information
  58. that helps understanding your changes.
  59. Basically, structure your commit message like this:
  60. <pre>
  61. One line summary (at most 50 characters)
  62. Longer description (wrap at 72 characters)
  63. </pre>
  64. ##### Commit title/summary
  65. * At most 50 characters
  66. * What was changed
  67. * Imperative present tense (Fix, Add, Change)
  68. * `Fix bug 123`
  69. * `Add 'foobar' command`
  70. * `Change default timeout to 123`
  71. * No period
  72. ##### Commit description
  73. * Wrap at 72 characters
  74. * Why, explain intention and implementation approach
  75. * Present tense