Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: pages/coding-style.html

Issue 29329899: Issue 3158 - Add CSS and HTML rules to coding style page (Closed)
Patch Set: Identifiers rename, consistency changes Created Nov. 10, 2015, 10:13 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 title=Coding Style 1 title=Coding Style
2 2
3 3
4 <h2 id="precedence">{{s1 Precedence}}</h2> 4 <h2 id="precedence">{{s1 Precedence}}</h2>
5 5
6 <p>{{s2 The Adblock Plus coding style is based on others. Our rules (both genera l and language specific) always overrule referenced style guides. The language s pecific sections overrule the general section.}}</p> 6 <p>{{s2 The Adblock Plus coding style is based on others. Our rules (both genera l and language specific) always overrule referenced style guides. The language s pecific sections overrule the general section.}}</p>
7 7
8 <h2 id="consistency">{{s3 Consistency}}</h2> 8 <h2 id="consistency">{{s3 Consistency}}</h2>
9 9
10 <p>{{s4 Consistency is most important: Be consistent within functions, files, mo dules and projects. Making existing code conform with this style guide is fine, but it should happen in dedicated commits, preferably for a whole module or proj ect at once.}}</p> 10 <p>{{s4 Consistency is most important: Be consistent within functions, files, mo dules and projects. Making existing code conform with this style guide is fine, but it should happen in dedicated commits, preferably for a whole module or proj ect at once.}}</p>
11 11
12 <h2 id="general">{{s5 General}}</h2> 12 <h2 id="general">{{s5 General}}</h2>
13 <ul> 13 <ul>
14 <li>{{s6 Follow the Mozilla Coding Style's <a href="https://developer.mozilla.or g/en-US/docs/Developer_Guide/Coding_Style#General_C.2FC.2B.2B_Practices">general practices</a> and its <a href="https://developer.mozilla.org/en-US/docs/Develop er_Guide/Coding_Style#Naming_and_Formatting_code">naming and formatting rules</a >.}}</li> 14 <li>{{s6 Follow the Mozilla Coding Style's <a href="https://developer.mozilla. org/en-US/docs/Developer_Guide/Coding_Style#General_C.2FC.2B.2B_Practices">gener al practices</a> and its <a href="https://developer.mozilla.org/en-US/docs/Devel oper_Guide/Coding_Style#Naming_and_Formatting_code">naming and formatting rules< /a>.}}</li>
15 <li>{{s7 Use 2 spaces per indentation level.}}</li> 15 <li>{{s7 Use 2 spaces per indentation level.}}</li>
16 <li>{{s8 All files should have a <a href="license-headers">license header</a>, b ut no mode line comments.}}</li> 16 <li>{{s8 All files should have a <a href="license-headers">license header</a>, but no mode line comments.}}</li>
17 <li>{{s9 Newline at end of file, otherwise no trailing whitespace.}}</li> 17 <li>{{s9 Newline at end of file, otherwise no trailing whitespace.}}</li>
18 <li>{{s10 Lines can be longer than the limit, if limiting line length would hurt readability in a particular case.}}</li> 18 <li>{{s10 Lines can be longer than the limit, if limiting line length would hu rt readability in a particular case.}}</li>
19 <li>{{s11 Opening braces always go on their own line.}}</li> 19 <li>{{s11 Opening braces always go on their own line.}}</li>
20 <li>{{s12 No hungarian notation, no special variable name prefixes or suffixes d enoting type or scope. All variable names start with a lower case letter.}}</li> 20 <li>{{s12 No hungarian notation, no special variable name prefixes or suffixes denoting type or scope. All variable names start with a lower case letter.}}</l i>
21 <li>{{s13 Don't comment code out, delete it.}}</li> 21 <li>{{s13 Don't comment code out, delete it.}}</li>
22 <li>{{todo-comments Don't add TODO comments, create an <a href="https://issues.a dblockplus.org">issue</a> and reference it in a comment instead.}}</li> 22 <li>{{todo-comments Don't add TODO comments, create an <a href="https://issues .adblockplus.org">issue</a> and reference it in a comment instead.}}</li>
23 </ul> 23 </ul>
24 24
25 <h2 id="javascript">{{s14 JavaScript}}</h2> 25 <h2 id="javascript">{{s14 JavaScript}}</h2>
26 <ul> 26 <ul>
27 <li>{{s15 Follow the Mozilla Coding Style's <a href="https://developer.mozilla.o rg/en-US/docs/Developer_Guide/Coding_Style#JavaScript_practices">JavaScript prac tices</a>.}}</li> 27 <li>{{s15 Follow the Mozilla Coding Style's <a href="https://developer.mozilla .org/en-US/docs/Developer_Guide/Coding_Style#JavaScript_practices">JavaScript pr actices</a>.}}</li>
28 <li>{{s16 Opening braces of object literals in don't go on their own line when t hat would cause a syntax error.}}</li> 28 <li>{{s16 Opening braces of object literals in don't go on their own line when that would cause a syntax error.}}</li>
29 <li>{{s17 Use <code>bind()</code> to ensure the desired value of the <code>this< /code> variable, don’t use temporary variables as a replacement.}}</li> 29 <li>{{s17 Use <code>bind()</code> to ensure the desired value of the <code>thi s</code> variable, don’t use temporary variables as a replacement.}}</li>
30 <li>{{s18 In classes, prefix private functions with a single underscore to make them pseudo-private.}}</li> 30 <li>{{s18 In classes, prefix private functions with a single underscore to mak e them pseudo-private.}}</li>
31 </ul>
32
33 <h2 id="html-css">{{html-css HTML and CSS}}</h2>
34 <ul>
35 <li>{{html-css-general Follow the <a href="https://google.github.io/styleguide /htmlcssguide.xml">Google HTML/CSS Style Guide</a>.}}</li>
36 <li>{{html-css-quotation Use double over single quotation marks.}}</li>
37 <li>{{html-css-optional-tag Don't omit optional HTML tags.}}</li>
38 <li>{{html-css-hexadecimal CSS color values should be specified in hexadecimal where possible.}}</li>
39 <li>{{html-css-shorthand CSS shorthand properties usage is optional.}}</li>
40 <li>{{html-css-order CSS rule declaration order should follow the <a href="htt ps://make.wordpress.org/core/handbook/best-practices/coding-standards/css/#prope rty-ordering">WordPress CSS Coding Standards</a>.}}</li>
41 <li>{{html-css-units CSS number values should specify units where possible.}}< /li>
42 <li>{{html-css-leading-zero CSS number values between -1 and 1 should specify a leading 0.}}</li>
31 </ul> 43 </ul>
32 44
33 <h2 id="python">{{s19 Python}}</h2> 45 <h2 id="python">{{s19 Python}}</h2>
34 <ul> 46 <ul>
35 <li>{{s20 Follow the Mozilla Coding Style's <a href="https://developer.mozilla.o rg/en-US/docs/Developer_Guide/Coding_Style#Python_Practices">Python practices</a >.}}</li> 47 <li>{{s20 Follow the Mozilla Coding Style's <a href="https://developer.mozilla .org/en-US/docs/Developer_Guide/Coding_Style#Python_Practices">Python practices< /a>.}}</li>
36 <li>{{s21 In modules, prefix private functions and variables with a single under score.}}</li> 48 <li>{{s21 In modules, prefix private functions and variables with a single und erscore.}}</li>
37 </ul> 49 </ul>
38 50
39 <h2 id="java">{{s22 Java}}</h2> 51 <h2 id="java">{{s22 Java}}</h2>
40 <ul> 52 <ul>
41 <li>{{s23 Follow the Mozilla Coding Style's <a href="https://developer.mozilla.o rg/en-US/docs/Developer_Guide/Coding_Style#Java_practices">Java practices</a>.}} </li> 53 <li>{{s23 Follow the Mozilla Coding Style's <a href="https://developer.mozilla .org/en-US/docs/Developer_Guide/Coding_Style#Java_practices">Java practices</a>. }}</li>
42 <li>{{s24 Imports should be organised consistently per file, we don't use global rules.}}</li> 54 <li>{{s24 Imports should be organised consistently per file, we don't use glob al rules.}}</li>
43 </ul> 55 </ul>
44 56
45 <h2 id="cpp">{{s25 C++}}</h2> 57 <h2 id="cpp">{{s25 C++}}</h2>
46 <ul> 58 <ul>
47 <li>{{s26 Follow the Mozilla Coding Style's <a href="https://developer.mozilla.o rg/en-US/docs/Developer_Guide/Coding_Style#C.2FC.2B.2B_practices">C++ practices< /a>.}}</li> 59 <li>{{s26 Follow the Mozilla Coding Style's <a href="https://developer.mozilla .org/en-US/docs/Developer_Guide/Coding_Style#C.2FC.2B.2B_practices">C++ practice s</a>.}}</li>
48 <li>{{s27 Indent namespace bodies.}}</li> 60 <li>{{s27 Indent namespace bodies.}}</li>
49 <li>{{s28 Avoid manual memory management: Use references and values when possibl e, smart pointers when necessary, raw pointers only for weak references.}}</li> 61 <li>{{s28 Avoid manual memory management: Use references and values when possi ble, smart pointers when necessary, raw pointers only for weak references.}}</li >
50 <li>{{s29 Don't use C-style casts unless its exact semantics are required.}}</li > 62 <li>{{s29 Don't use C-style casts unless its exact semantics are required.}}</ li>
51 <li>{{s30 We tend to use anonymous namespaces instead of static.}}</li> 63 <li>{{s30 We tend to use anonymous namespaces instead of static.}}</li>
52 </ul> 64 </ul>
53 65
54 <h2 id="objc">{{objective-c Objective-C}}</h2> 66 <h2 id="objc">{{objective-c Objective-C}}</h2>
55 <ul> 67 <ul>
56 <li>{{objc-conventions Follow Apple's <a href="https://developer.apple.com/lib rary/ios/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/Conventions/Co nventions.html">conventions</a>}}.</li> 68 <li>{{objc-conventions Follow Apple's <a href="https://developer.apple.com/lib rary/ios/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/Conventions/Co nventions.html">conventions</a>}}.</li>
57 </ul> 69 </ul>
58 70
59 <h2 id="puppet">{{s31 Puppet}}</h2> 71 <h2 id="puppet">{{s31 Puppet}}</h2>
60 <ul> 72 <ul>
61 <li>{{s32 Follow the <a href="http://docs.puppetlabs.com/guides/style_guide.html ">Puppet Style Guide</a>.}}</li> 73 <li>{{s32 Follow the <a href="http://docs.puppetlabs.com/guides/style_guide.ht ml">Puppet Style Guide</a>.}}</li>
62 <li>{{s33 Opening braces don't go on their own line.}}</li> 74 <li>{{s33 Opening braces don't go on their own line.}}</li>
63 <li>{{s34 Arrows should not be aligned.}}</li> 75 <li>{{s34 Arrows should not be aligned.}}</li>
64 </ul> 76 </ul>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld