From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] doc: add coding standards documentation Date: Tue, 02 Jun 2015 14:59:24 +0200 Message-ID: <3429374.q3aYeV0bsN@xps13> References: <1431531022-29697-1-git-send-email-bruce.richardson@intel.com> <1431531022-29697-2-git-send-email-bruce.richardson@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: Bruce Richardson Return-path: Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by dpdk.org (Postfix) with ESMTP id CE579ADA7 for ; Tue, 2 Jun 2015 15:00:14 +0200 (CEST) Received: by wifw1 with SMTP id w1so143745073wif.0 for ; Tue, 02 Jun 2015 06:00:14 -0700 (PDT) In-Reply-To: <1431531022-29697-2-git-send-email-bruce.richardson@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2015-05-13 16:30, Bruce Richardson: > Add coding standards document to guides directory. This document > codifies the current DPDK C coding conventions, to make it easier for > contributors to see the format their code should be in. > > Signed-off-by: Bruce Richardson > Signed-off-by: Siobhan Butler Thanks for your work. It would be nice to apply this doc baseline shortly in order to be able to update it, one change at a time. > new file mode 100755 wrong file mode non-Linux filesystem spotted ;) > index 0000000..b2e522e > --- /dev/null > +++ b/doc/guides/coding_standards/index.rst > @@ -0,0 +1,806 @@ > +Coding Style > +============= > + > +Description > +----------- > + > +This document specifies the preferred style for source files in the DPDK source tree. It is based on the Linux Kernel coding guidelines and the FreeBSD 7.2 Kernel Developer's Manual (see man style(9)), but was heavily modified for the needs of the DPDK. > + > +General Guidelines > +------------------ > + > +The rules and guidelines given in this document cannot cover every situation, so the following general guidelines should be used as a fallback: > + > +* The code style should be consistent within each individual file. > +* In the case of creating new files, the style should be consistent within each file in a given directory or module. > +* The primary reason for coding standards is to increase code readability and comprehensibility, therefore always use whatever option will make the code easiest to read. > + > +Line length is recommended to be not more than 80 characters, including comments. [Tab stop size should be assumed to be 8-characters wide]. Don't you think we should wrap lines a little to make future changes easier to review? In general, there is no reason to put more than 1 idea or sentence on 1 line. Don't forget that carriage return are ignored when rst docs are built. > --- a/doc/guides/index.rst > +++ b/doc/guides/index.rst > @@ -45,3 +45,5 @@ Contents: > sample_app_ug/index > testpmd_app_ug/index > rel_notes/index > + coding_standards/index > + 1 byte to save ;)