-
Notifications
You must be signed in to change notification settings - Fork 724
Closed
Description
With an active and diverse developer community we need to spell out more clearly what we want the code to look like, i.e. we need a Style Guide.
Related questions have come up recently in #392 and #393 but there are also the recurring discussions about length of lines etc., in particular see #216 !
A very basic guideline consists of the editor settings:
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8
- only use spaces for indentation
- one level of indentation equals 4 spaces
Generally, PEP 8 is a good starting point (see #216 )
Either edit this post or add a comment and someone will add an item to the list below.
Questions to settle
Code
- line length (
8079 chars) - indentation (spaces, 4 per level)
- imports (absolute, aliasing eg
import numpy as np
import numpy as np #392) - capitalization (underscore_methods, CapitalClasses, etc as per pep8)
- camelCase or underscores (underscores, see goodBye camelCase #389)
-
add style checker to travis(nope, but encourage style helpers) - Where does Cython code live Source file locations #444 ?
Testing
- how to write tests (see Unit Tests: developer guide and relative imports and nosetests #189)
Documentation
- git commit messages (subject line, empty line, body, see e.g. a note about git commit messages)
- Move docstrings to numpy style
- finally immortalise as wiki page Style Guide