From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bruce Richardson Subject: Re: [PATCH] doc: add coding standards documentation Date: Wed, 3 Jun 2015 11:43:18 +0100 Message-ID: <20150603104318.GA12832@bricha3-MOBL3> References: <1431531022-29697-1-git-send-email-bruce.richardson@intel.com> <1431531022-29697-2-git-send-email-bruce.richardson@intel.com> <3429374.q3aYeV0bsN@xps13> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org To: Thomas Monjalon Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 87EC45A58 for ; Wed, 3 Jun 2015 12:43:22 +0200 (CEST) Content-Disposition: inline In-Reply-To: <3429374.q3aYeV0bsN@xps13> 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" On Tue, Jun 02, 2015 at 02:59:24PM +0200, Thomas Monjalon wrote: > 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 ;) > Ooops, my secret is out! :-) > > 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. > Ok, I'll have a quick scan through to see how I can improve things. I agree one sentence per line is best. > > --- 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 ;) > I'll fix that in the V2 /Bruce