-
Notifications
You must be signed in to change notification settings - Fork 8
Style Guide
brownhead edited this page Apr 16, 2013
·
1 revision
Style isn't really something that I want anyone to spend a lot of time dealing with, so these rules are as minimal as I can make them.
- Use 4 spaces for each indent.
- Ensure there is a newline at the end of every file (most editors have a way to automatically do this for you).
- CamelCase for class names only, everything else (functions and variables) should use underscores (ex: foo_bar).
- Every source file must have license header at the top, even if the file is empty.
class Bar:
def __init__(self):
self.counter = 3
def pet_hamster(self):
Pimport hamster
hamster.pet()
- Use the past tense when writing commit messages rather than the present tense.
- Limit the first line of the commit message to 50 characters. Vim will automatically use angry colors if you go over this limit.
- Details (if needed) should be written in bullet point form (using asterisks as bullets, no whitespace before the asterisk).
- Use proper punctuation, grammar, capitilization, etc.
Added dependency to foo.py.
* Was missing hamster module.
* Fixed #9999.
Fixed #219.
- If selector has one attribute, all of it goes on one line, otherwise use multiple lines with brace on the same line as the selector.
- Each attribute on its own line (always ending with a semicolon).
- The ending brace on a line of its own with no indentation.
- Each block must be surrounded by a single blank line on both sides.
- Pixels (px) rather than ems should be used.
- Always use semi-colons.
- Curly braces should be on the same line as the control structure.
- Use tabs rather than spaces.
- Do not indent after Jinja2 control structures.
- Same naming rules as for Python.
{% if submission.show_resubmit %}
<div>
<a href="resubmit/{{ submission.id }}"><input type="button" value="Resubmit"></a>
</div>
{% endif %}
if (files_added > 0) {
$(this).attr("disabled", "disabled");
$("form").submit();
}
General
- Home
- User Guide (for admins and teachers)
- Comparison to Similar Software
- Goals and Ideals
- Credits and Contributers
Administration
Development