This page is an effort to document the recommended coding standards for Project Sycamore.
Python Code
Unless otherwise stated all Sycamore python code must follow the Style Guide for Python Code.
Note: Please spell out acronyms if there is no word before the acronym (for example use CommandLineInterface instead of just CLI).
Whitespace
-
Do not mix tabs with spaces
-
Use exactly four spaces to indent each level
Class Names
All class names must follow the CapitalizedWords format.
Examples
class Page(object): ... class GroupDict(DictDict): ...
The following is an example with an embedded acronym.
class RequestCLI(RequestBase): ...
File and Directory Names
The following restrictions have been made for all file and directory names.
-
Must not contain spaces
-
Must contain only ASCII letters, numbers, underscores, periods, and dashes
-
May contain upper and lower case ASCII letters
Database
This section describes the coding standards for all structures related to the database.
Tables
The following restrictions have been made for all database table names.
-
Must not contain spaces
-
Must only contain UPPERCASE ASCII letters and underscores
-
Must be plural, if the name contains many words only the last word should be plural
-
Words must be split up by underscores
-
Must not contain a suffix
-
May only contain a prefix if it is configurable at runtime and/or installation time
-
Must be unique within the entire database schema
Views
The same restrictions for tables apply to all database views. The following conditions also apply.
-
All views must contain a common, configurable suffix (ie _view)
Fields
The following restrictions have been made for all database field names.
-
Must not contain spaces
-
Must only contain lowercase ASCII letters and underscores
-
Must be singular
-
Must be unique within the entire database schema
Queries
The following restrictions have been made on all database queries.
-
SQL keywords (ie SELECT, INSERT, etc) must be CAPITALIZED
-
When surrounding a string the single quote character must be used (MySQL allows the double quote character but this should be discouraged)
Comments:
Note: You must be logged in to add comments
This all looks good to me. —PhilipNeustrom
2007-07-12 03:14:28 I'm working through PEP-8 in the wikis branch. It will take a while for all of the code to be in a standardized format, but it's already looking much better. —PhilipNeustrom