PageRenderTime 30ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 1ms

/docs/hacking.rst

https://bitbucket.org/sjl/hg-review/
ReStructuredText | 159 lines | 121 code | 38 blank | 0 comment | 0 complexity | 2404c9660cb19369332a106555de64af MD5 | raw file
Possible License(s): GPL-2.0, BSD-3-Clause
  1. Hacking hg-review
  2. =================
  3. Want to improve hg-review? Great!
  4. The easiest way is to make some changes, push them somewhere public and send
  5. a pull request on Bitbucket (or `email Steve <mailto:steve@stevelosh.com>`_).
  6. Rough Guidelines
  7. ----------------
  8. Here's a few tips that will make hg-review's maintainer happier.
  9. Basic Coding Style
  10. ''''''''''''''''''
  11. Keep lines of code under 85 characters, unless it makes things *really* ugly.
  12. Indentation is four spaces. Tabs are evil.
  13. Commit Messages
  14. '''''''''''''''
  15. Commit messages should start with a line like::
  16. api: add feature X
  17. The first part is the component the change affects, like ``api``, ``cli``,
  18. ``web``, ``docs/api``, or ``guts``.
  19. ``guts`` is a catchall for changesets that affect everything at once -- using
  20. it means that the changeset could probably be split up into separate smallet
  21. changesets.
  22. The rest of the commit message should describe the change.
  23. Tests
  24. '''''
  25. Update the tests *in the same changeset as your change*. This makes bisection
  26. by running the test suite easier.
  27. If your changeset changes the CLI output, make sure you've read the next
  28. section and then add a test for it *in the same changeset*.
  29. If your changeset adds a new feature, add a test for it *in the same
  30. changeset*.
  31. If your changeset fixes a bug, add a test that would reproduce the bug *in the
  32. same changeset*.
  33. Backwards Compatibility
  34. '''''''''''''''''''''''
  35. hg-review's internal implementation is not stable. Feel free to modify it
  36. however you like. Patches that clean up the code and/or enhance performance
  37. will be gladly accepted.
  38. hg-review's file format is stable, but new fields may be added at any time.
  39. Removing a field or changing its format is not allowed without a very good
  40. reason. Adding an entirely new file format may be acceptable if there is
  41. a compelling reason.
  42. hg-review's command line interface is stable. Adding new commands or adding new
  43. options to existing commands is fine if they prove useful. Removing commands or
  44. radically changing the default output of existing commands is not acceptable
  45. except in extreme cases.
  46. hg-review is currently compatible with Python 2.5+ and Mercurial 1.6+. Patches
  47. that break this compatibility will be met with a large dose of skepticism.
  48. Layout
  49. ------
  50. hg-review's basic structure looks like this::
  51. hg-review/
  52. |
  53. +-- bundled/
  54. | |
  55. | `-- ... bundled third-party modules ...
  56. |
  57. +-- contrib/
  58. | |
  59. | `-- ... useful items not critical to hg-review's core ...
  60. |
  61. +-- docs/
  62. | |
  63. | `-- ... the documentation (and theme) ...
  64. |
  65. +-- review/
  66. | |
  67. | +-- static/
  68. | | |
  69. | | `-- ... static media for the web ui ...
  70. | |
  71. | +-- templates/
  72. | | |
  73. | | `-- ... jinja2 templates for the web ui ...
  74. | |
  75. | +-- tests/
  76. | | |
  77. | | ` ... unit test files and accompanying utilities ...
  78. | |
  79. | +-- api.py # the core hg-review backend
  80. | |
  81. | +-- cli.py # the hg-review Mercurial extension CLI
  82. | |
  83. | +-- messages.py # messages used by the CLI
  84. | |
  85. | +-- helps.py # help text for the CLI commands
  86. | |
  87. | +-- rutil.py # useful utilities
  88. | |
  89. | `-- web.py # the web interface
  90. |
  91. +-- README.markdown
  92. |
  93. +-- LICENSE
  94. |
  95. +-- fabfile.py
  96. |
  97. `-- kick.py
  98. Testing
  99. -------
  100. hg-review contains a test suite for the command line interface (and therefore
  101. the backend API as well).
  102. The tests can be run easily with nose. If you don't have node, you'll need to
  103. install it first::
  104. pip install nose
  105. Once you've got it you can run the suite by cd'ing to the hg-review directory
  106. and running ``nosetests``.
  107. Before submitting a changeset please make sure it doesn't break any tests.
  108. If your changeset adds a new feature, add a test for it *in the same
  109. changeset*.
  110. If your changeset fixes a bug, add a test that would reproduce the bug *in the
  111. same changeset*.
  112. Documentation
  113. -------------
  114. If you want to submit a patch, please update the documentation to reflect your
  115. change (if necessary) *in the same changeset*.
  116. The documentation is formatted as restructured text and built with Sphinx
  117. (version 0.6.7).
  118. The CSS for the documentation is written with LessCSS. If you want to update
  119. the style you should update the ``docs/hgreview/static/review.less`` file and
  120. render it to CSS. Include the changes to the ``.less`` file *and* the ``.css``
  121. file in your changeset.