Coding Standards » History » Version 3

Eric Davis, 2010-10-22 19:06
Adding some standards, esp around tests

1 2 Eric Davis
{{toc}}
2 2 Eric Davis
3 1 Eric Davis
h1. Coding Standards
4 1 Eric Davis
5 1 Eric Davis
h2. Ruby and Rails Code
6 1 Eric Davis
7 1 Eric Davis
TODO: until then, follow the basic Ruby and Rails standards.
8 1 Eric Davis
9 1 Eric Davis
h2. Javascript
10 1 Eric Davis
11 1 Eric Davis
TODO
12 1 Eric Davis
13 1 Eric Davis
h2. CSS
14 1 Eric Davis
15 1 Eric Davis
TODO
16 1 Eric Davis
17 3 Eric Davis
h2. Documentation
18 3 Eric Davis
19 3 Eric Davis
Document you methods as needed and make sure any complex code is explained (e.g. regular expression parsing).  If it can't be understood 7 days later, it won't be understand next year and will need to be rewritten.
20 3 Eric Davis
21 3 Eric Davis
h2. Tests
22 3 Eric Davis
23 3 Eric Davis
Make sure any new code is tested, especially in the Controllers and Models.  Code without tests may (and probably will) be rejected on that reason alone.  Redmine is a very complex application with a lot of authentication and authorization code, so it's vital that changes are tested fully. Please don't take any offensive from this hard stance, protecting everyone's data and trust in the system is very important.
24 3 Eric Davis
25 1 Eric Davis
h2. Commits
26 1 Eric Davis
27 1 Eric Davis
Commits should be formatted as below.  If you are contributed via git, this will save the committer a bunch of time:
28 1 Eric Davis
29 1 Eric Davis
<pre>
30 1 Eric Davis
Short summary of your commit, 72 characters. #nnnn
31 1 Eric Davis
32 1 Eric Davis
(This is optional) Longer description of the change, including a 
33 1 Eric Davis
list of what changed if it's a major change. Limit each line to 72
34 1 Eric Davis
characters and use basic textile (* for lists). 
35 1 Eric Davis
36 1 Eric Davis
Contributed by Your Name
37 1 Eric Davis
</pre>