diff options
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | docs/contributing.rst | 46 |
2 files changed, 45 insertions, 3 deletions
diff --git a/.travis.yml b/.travis.yml index defcd77b..6d164863 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ env: install: - "[[ ${TOX_ENV} == pypy ]] && sudo add-apt-repository -y ppa:pypy/ppa || true" - - "[[ ${TOX_ENV} == pypy ]] && sudo apt-get -y update && sudo apt-get -y install pypy || true" + - "[[ ${TOX_ENV} == pypy ]] && (sudo apt-get -y update || true) && sudo apt-get -y install pypy || true" # This is required because we need to get rid of the Travis installed PyPy # or it'll take precedence over the PPA installed one. - "[[ ${TOX_ENV} == pypy ]] && sudo rm -rf /usr/local/pypy/bin || true" diff --git a/docs/contributing.rst b/docs/contributing.rst index 2d8fceeb..b125d1af 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -20,8 +20,8 @@ devastating, ``cryptography`` has a strict code review policy: * Patches must *never* be pushed directly to ``master``, all changes (even the most trivial typo fixes!) must be submitted as a pull request. * A committer may *never* merge their own pull request, a second party must - merge their changes. If multiple people work on a pull request, the merger - may not be any of them. + merge their changes. If multiple people work on a pull request, it must be + merged by someone who did not work on it. * A patch which breaks tests, or introduces regressions by changing or removing existing tests should not be merged. Tests must always be passing on ``master``. @@ -50,6 +50,48 @@ Additionally, every Python code file must contain from __future__ import absolute_import, division, print_function +C bindings +---------- + +When binding C code with ``cffi`` we have our own style guide, it's pretty +simple. + +Don't name parameters: + +.. code-block:: c + + // Good + long f(long); + // Bad + long f(long x); + +Don't include stray ``void`` parameters: + +.. code-block:: c + + // Good + long f(); + // Bad + long f(void); + +Wrap lines at 80 characters like so: + +.. code-block:: c + + // Pretend this went to 80 characters + long f(long, long, + int *) + +Include a space after commas between parameters: + +.. code-block:: c + + // Good + long f(int, char *) + // Bad + long f(int,char *) + + Documentation ------------- |