Merge pull request #103 from kuba/style

Policies for pull requests. Coding style.
This commit is contained in:
James Kasten
2014-11-29 16:13:39 -08:00
+42 -2
View File
@@ -53,9 +53,49 @@ sudo ./venv/bin/letsencrypt
## Hacking
1. Bootstrap: `./venv/bin/python setup.py dev`
In order to start hacking, you will first have to create a development
environment:
2. Test code base: `./venv/bin/tox`
`./venv/bin/python setup.py dev`
The code base, including your pull requests, **must have 100% test
statement coverage and be compliant with the [coding
style](#coding-style)**. The following tools are there to help you:
- `./venv/bin/tox` starts a full set of tests. Please make sure you
run it before submitting a new pull request.
- `./venv/bin/tox -e cover` checks the test coverage only.
- `./venv/bin/tox -e lint` checks the style of the whole project,
while `./venv/bin/pylint file` will check a single `file` only.
### Coding style
Most importantly, **be consistent with the rest of the code**, please.
1. Read [PEP 8 - Style Guide for Python Code]
(https://www.python.org/dev/peps/pep-0008).
2. Follow [Google Python Style Guide]
(https://google-styleguide.googlecode.com/svn/trunk/pyguide.html),
with the exception that we use [Sphinx](http://sphinx-doc.org/)-style
documentation:
```python
def foo(arg):
"""Short description.
:param int arg: Some number.
:returns: Argument
:rtype: int
"""
return arg
```
3. Remember to use `./venv/bin/pylint`.
## Command line usage