Skip to content
kynan edited this page Dec 13, 2012 · 2 revisions

Coding Guidelines

Checking your commit conforms to coding guidelines

Install a Git pre-commit hook automatically checking for tab and whitespace errors before committing. In the root directory of your local Git repository do

git config --local core.whitespace "space-before-tab, tab-in-indent, trailing-space, tabwidth=4"
mv .git/hooks/pre-commit.sample .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit

Coding guidelines

We're loosely following PEP 0008, in particular:

  • indent by 4 spaces, tabs are strictly forbidden
  • lines should not exceed 79 characters
  • no trailing whitespace at EOL or trailing blank lines at EOF