This repository has been archived by the owner on Aug 20, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
/
STYLE_GUIDELINES
41 lines (31 loc) · 1.68 KB
/
STYLE_GUIDELINES
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
== Javascript ==
Javascript code follows the coding conventions set out in
http://www.mediawiki.org/wiki/Manual:Coding_conventions/JavaScript
There is one crucial exception in that this project uses slightly different whitespace rules:
there is no need for a space at the start or end in parentheses.
e.g.
function name(arg1, arg2) {
// do this
}
var x = function(arg1, arg2) {
// do this
}
if(x == 4) {
// do this
}
for(x = 0; x < 5; x++) {
// do this
}
== CSS ==
CSS code should follow the guidelines set out in http://www.mediawiki.org/wiki/Manual:Coding_conventions/CSS
== HTML ==
HTML should validate via http://validator.w3.org/
== COMMITS ==
* Commits are important as they give the reviewer more information to successfully review your code and find errors or potential problems you might not have thought of
* Commits are also useful when troubleshooting issues and refactoring. If it's not clear why a line of code is in the repository important bug fixes could be lost.
* Commits should be as minor as possible. Please avoid removing unrelated console.log statements, fixing unrelated whitespace etc.. do that in a separate commit which mentions the word cleanup.
* First line commit should summarise the commit with bug it fixes if applicable. e.g. Fix problem with toggling see bug x
* Second line should be blank
* Third line should go into detail where necessary providing links to blog posts/other bugs to provide more background. Mention the platforms/browsers the change is for where necessary
** e.g. 'this is a problem on android but not osx see http://<url> which explains problem in detail'
** e.g. 'this is a workaround for a known bug in opera mobile see http://<url>'