From e6466a50ea3ee6798c904649d6c67e01eef96b14 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Fri, 18 Oct 2013 14:53:04 -0700 Subject: Document our style guide for C bindings --- docs/contributing.rst | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) (limited to 'docs/contributing.rst') diff --git a/docs/contributing.rst b/docs/contributing.rst index 2d8fceeb..7bb7c43e 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,39 @@ 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 *) + + Documentation ------------- -- cgit v1.2.3 From 1e8744a5bf9dc09215f9aed9606081fc6eee517a Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Fri, 18 Oct 2013 14:57:18 -0700 Subject: DOcument the use of spaces here --- docs/contributing.rst | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'docs/contributing.rst') diff --git a/docs/contributing.rst b/docs/contributing.rst index 7bb7c43e..b125d1af 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -82,6 +82,15 @@ Wrap lines at 80 characters like so: 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 ------------- -- cgit v1.2.3 From 99b69d94cf95b39164dd9d35ff7a463b7a1b7f20 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sat, 19 Oct 2013 17:52:58 -0700 Subject: Start better documenting our security procedure --- docs/contributing.rst | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'docs/contributing.rst') diff --git a/docs/contributing.rst b/docs/contributing.rst index b125d1af..dc8ce453 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -32,11 +32,8 @@ devastating, ``cryptography`` has a strict code review policy: The purpose of these policies is to minimize the chances we merge a change which jeopardizes our users' security. -We do not yet have a formal security contact. To report security issues in -``cryptography`` you should email ``alex.gaynor@gmail.com``, messages may be -encrypted with PGP to key fingerprint -``E27D 4AA0 1651 72CB C5D2 AF2B 125F 5C67 DFE9 4084`` (this public key is -available from most commonly-used keyservers). +If you believe you've identified a security issue in ``cryptography``, please +follow the directions on the :doc:`security page `. Code ---- -- cgit v1.2.3 From 3ed80ba1c1773a0e45538e432573d91cfb388b0f Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Sat, 19 Oct 2013 20:00:26 -0500 Subject: add struct style info to docs --- docs/contributing.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'docs/contributing.rst') diff --git a/docs/contributing.rst b/docs/contributing.rst index b125d1af..fe87ac29 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -65,6 +65,16 @@ Don't name parameters: // Bad long f(long x); +...unless they're inside a struct: + +.. code-block:: c + + struct my_struct { + char *name; + int number; + ...; + }; + Don't include stray ``void`` parameters: .. code-block:: c -- cgit v1.2.3