Project

General

Profile

Coding Standards » History » Revision 13

Revision 12 (Toshi MARUYAMA, 2011-03-16 02:12) → Revision 13/14 (Jean-Baptiste Barth, 2011-06-13 22:42)

h1. Coding Standards 

 {{>toc}} 

 h2. Ruby and Rails Code 

 TODO: until then, follow the basic Ruby and Rails standards. 

 * *Views* 
 ** use @blank? / present?@ instead of @empty? / any? / nil?@ when it doesn't affect code readability 

 h2. Javascript 

 TODO 

 h2. CSS 

 TODO 

 h2. Documentation 

 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 understood next year and will need to be rewritten. 

 h2. Tests 

 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 offense from this hard stance, protecting everyone's data and trust in the system is very important. 

 h2. Commits 

 Commits should be formatted as below.    If you are contributed via git, this will save the committer a bunch of time: 

 <pre> 
 Short summary of your commit, 72 characters. #nnnn 

 (This is optional) Longer description of the change, including a  
 list of what changed if it's a major change. Limit each line to 72 
 characters and use basic textile (* for lists).  

 Contributed by Your Name 
 </pre>