README.coding 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. Some small guidelines if you want to help coding
  2. ------------------------------------------------
  3. First: I'm always happy to get patches for Dak. I like to merge
  4. enhancements, bugfixes, whatever. The more, the better.
  5. Now, to not annoy us all by coming up with small fixes to patches
  6. multiple times before I merge them, lets write down a few small
  7. guidelines we all should follow. Yes, the current dakV1 code sure won't
  8. follow this everywhere, but no need to have new code be the same. :)
  9. I very much prefer git trees to merge from over simple patches,
  10. especially if you do lots of changes. (No need for a full git tree for a
  11. one-off fix). Reason is simple - its much easier to work with. And it is
  12. also way better in terms of assigning who did what, who has to earn the
  13. praise. :)
  14. In case you have more than one feature you want me to merge, one branch
  15. per feature please. If the location of your git tree is stable and
  16. doesn't change every second day I'm also very grateful. :)
  17. Code related:
  18. - Use readable and self-speaking variable names.
  19. - Its 4 spaces per indentation. No tab.
  20. - You want to make sure to not add useless whitespaces. If your editor
  21. doesn't hilight them, Git can help you with that, just set
  22. [color "diff"]
  23. new = green
  24. old = red
  25. frag = yellow
  26. meta = cyan
  27. commit = normal
  28. in your ~/.gitconfig, and a git diff should hilight them.
  29. Even better, if you enable the hook pre-commit in your copy of the dak
  30. code (chmod +x most probably), git will refuse to commit such things.
  31. - Describe *every* function you write using a docstring. No matter how small.
  32. - Also describe every file.
  33. - Don't forget the Copyright/License header in a file. We expect GPLv2 :)
  34. - Don't write long functions. If it goes above a sane limit (like 50
  35. lines) - split it up.
  36. - Look at / read http://www.python.org/dev/peps/pep-0008/
  37. VCS related:
  38. - History rewriting is considered bad.
  39. - Always have a "Signed-off-by" line in your commit. `git commit -s`
  40. automatically does it for you. Alternatively you can enable the hook
  41. "prepare-commit-msg, that should also do it for you.
  42. - Write good, meaningful, commit messages. We do not have a Changelog
  43. file anymore, the git commit is *the* place to tell others what you
  44. did.
  45. Also, try to use the standard format used in the Git world:
  46. First comes a summary line, of around 72 caracters at most.
  47. Then, a blank line, and as many lines and paragraphs as needed
  48. to describe the change in detail. Beware, though, of including
  49. in the commit message explanations that would be better to have
  50. as comments in the code itself!
  51. Signed-off-by: Your Name <and@address.com>