From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/303 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Unit tests Date: Tue, 26 Apr 2011 20:32:44 -0400 Message-ID: <20110427003244.GX277@brightrain.aerifal.cx> References: <20110410044515.GB13185@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1312595713 11511 80.91.229.12 (6 Aug 2011 01:55:13 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 6 Aug 2011 01:55:13 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: envelope-from@hidden Wed Apr 27 00:39:02 2011 Content-Disposition: inline In-Reply-To: <20110426191430.GA10859@openwall.com> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:303 Archived-At: On Tue, Apr 26, 2011 at 11:14:30PM +0400, Solar Designer wrote: > Rich - > > You could want to define the coding style for the project, perhaps to > match musl's. For example, in Owl we're using a coding style similar to > that achieved with the following "indent" program options: > > indent -kr -i8 -nlp -nbbo -l79 -lc79 > > (these are given in Owl/doc/CONVENTIONS). musl's indention style is pretty close to k&r, basically the following. i'd be happy if the unit tests project can do similar: - use tabs for indention levels; set them to show up at whatever width you prefer in your editor. - avoid using so many indention levels (assuming 8-space tabs) that you have to exceed 79 chars or break up lines too often. - use spaces for alignment, i.e. if you want to extend past the indention level to line up continued lines, data tables, comments. - put braces on new line only for function bodies, otherwise on the same line as the loop/conditional statement. braces before and after else statements should be on the same line as the else. within a single if/else if/else construct, be consistent - use braces for all of them or none of them. - uses spaces after conditional/loop keywords, but not after the function name in declarations/calls. - otherwise, there is no strict rule for spaces, but avoid excessive spaces and try to use them to highlight operator precedence as alternatives to inserting redundant parentheses. (i find nested parentheses hard to track visually, guess that's why i never liked lisp... ;-) rich