summary refs log tree commit diff
path: root/docs/implementation-notes/code_style.rst
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2014-08-28 09:45:05 +0100
committerKegan Dougal <kegan@matrix.org>2014-08-28 09:45:05 +0100
commit660129deb1bb60dac04ff59d1da8bbe53882149e (patch)
tree79ca7c082e24e3039e75b3c0457cebd8a564f99a /docs/implementation-notes/code_style.rst
parentFix up the various presence-related tests so that if they're not skipped, the... (diff)
downloadsynapse-660129deb1bb60dac04ff59d1da8bbe53882149e.tar.xz
Shuffle files around in /docs
Diffstat (limited to 'docs/implementation-notes/code_style.rst')
-rw-r--r--docs/implementation-notes/code_style.rst18
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/implementation-notes/code_style.rst b/docs/implementation-notes/code_style.rst
new file mode 100644
index 0000000000..d7e2d5e69e
--- /dev/null
+++ b/docs/implementation-notes/code_style.rst
@@ -0,0 +1,18 @@
+Basically, PEP8
+
+- Max line width: 80 chars.
+- Use camel case for class and type names
+- Use underscores for functions and variables.
+- Use double quotes.
+- Use parentheses instead of '\' for line continuation where ever possible (which is pretty much everywhere)
+- There should be max a single new line between:
+    - statements
+    - functions in a class
+- There should be two new lines between:
+    - definitions in a module (e.g., between different classes)
+- There should be spaces where spaces should be and not where there shouldn't be:
+    - a single space after a comma
+    - a single space before and after for '=' when used as assignment
+    - no spaces before and after for '=' for default values and keyword arguments.
+
+Comments should follow the google code style. This is so that we can generate documentation with sphinx (http://sphinxcontrib-napoleon.readthedocs.org/en/latest/)