From: Rich Felker <dalias@aerifal.cx>
To: musl@lists.openwall.com
Subject: Re: Unit tests
Date: Tue, 26 Apr 2011 20:32:44 -0400 [thread overview]
Message-ID: <20110427003244.GX277@brightrain.aerifal.cx> (raw)
In-Reply-To: <20110426191430.GA10859@openwall.com>
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
next prev parent reply other threads:[~2011-04-27 0:32 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-10 4:45 Simple testing task - string functions Rich Felker
2011-04-10 12:08 ` Luka Marčetić
2011-04-10 15:25 ` JIghtuse
2011-04-10 15:34 ` Rich Felker
2011-04-10 15:46 ` keep discussion threads separate (was: Simple testing task - string functions) Solar Designer
2011-04-14 17:59 ` Simple testing task - string functions Luka Marčetić
2011-04-14 23:11 ` Rich Felker
2011-04-18 12:20 ` Luka Marčetić
2011-04-25 19:34 ` Unit tests Luka Marčetić
2011-04-26 19:14 ` Solar Designer
2011-04-27 0:32 ` Rich Felker [this message]
2011-04-27 0:42 ` Rich Felker
2011-04-27 6:29 ` Luka Marčetić
2011-04-29 5:36 ` Solar Designer
2011-04-29 11:54 ` Christian Neukirchen
2011-05-01 19:36 ` Solar Designer
2011-05-02 8:51 ` Christian Neukirchen
2011-05-02 12:49 ` Solar Designer
2011-05-02 13:02 ` errno
2011-05-02 13:11 ` Rich Felker
2011-05-02 13:30 ` Solar Designer
2011-05-02 13:32 ` Rich Felker
2011-05-02 13:52 ` Solar Designer
2011-05-02 13:27 ` Solar Designer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110427003244.GX277@brightrain.aerifal.cx \
--to=dalias@aerifal.cx \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).