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

Unified Diff: pages/coding-style.html

Issue 29340492: Issue 3950 - Extend the Python coding practices (Closed)
Patch Set: Created April 18, 2016, 11:17 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pages/coding-style.html
===================================================================
--- a/pages/coding-style.html
+++ b/pages/coding-style.html
@@ -12,7 +12,6 @@
<h2 id="general">{{s5 General}}</h2>
<ul>
<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">general practices</a> and its <a href="https://developer.mozilla.org/en-US/docs/Developer_Guide/Coding_Style#Naming_and_Formatting_code">naming and formatting rules</a>.}}</li>
- <li>{{s7 Use 2 spaces per indentation level.}}</li>
Sebastian Noack 2016/04/18 11:20:10 As we use 4 spaces for Python and 2 spaces for eve
<li>{{s8 All files should have a <a href="license-headers">license header</a>, but no mode line comments.}}</li>
<li>{{s9 Newline at end of file, otherwise no trailing whitespace.}}</li>
<li>{{s10 Lines can be longer than the limit, if limiting line length would hurt readability in a particular case.}}</li>
@@ -44,8 +43,10 @@
<h2 id="python">{{s19 Python}}</h2>
<ul>
- <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>
- <li>{{s21 In modules, prefix private functions and variables with a single underscore.}}</li>
+ <li>{{python-general Follow <a href="https://www.python.org/dev/peps/pep-0008/">PEP-8</a> and the Mozilla Coding Style's <a href="https://developer.mozilla.org/en-US/docs/Developer_Guide/Coding_Style#Python_Practices">Python practices</a>.}}</li>
+ <li>{{python-prefix In modules, prefix private functions and variables with a single underscore.}}</li>
+ <li>{{python-concatenation Use the <code><fix>+</fix></code> operator when concatenating exactly two string, use the <a href="https://docs.python.org/2/library/stdtypes.html#str.format"><code><fix>format()</fix></code> method</a> when concatenating more strings.}}</li>
+ <li>{{python-tuple-vs-list Use tuples for data that have structure, use lists for data that have order.}}</li>
</ul>
<h2 id="java">{{s22 Java}}</h2>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld