X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=devel%2FSTYLE;h=da6531248feb7e827c6f5066faaf1049a61a2652;hp=b22d8d353e15c11c0827bf7adf38e8eefe8843ba;hb=HEAD;hpb=99a0a90f65f5a98d2562e36b48b3e423233c2eb4 diff --git a/devel/STYLE b/devel/STYLE index b22d8d35..b18a9573 100644 --- a/devel/STYLE +++ b/devel/STYLE @@ -53,11 +53,19 @@ function (param_type param, param_type param) if/for/while test) and are preceded by a space. The opening brace of functions is the exception, and starts on a new line. -* Comments are always C-style /* */ block comments. They should start - with a capital letter and generally be written in complete - sentences. Public library functions are documented immediately - before their prototype in lib/notmuch.h. Internal functions are - typically documented immediately before their definition. +* Opening parens also cuddle, even if the first argument does not fit + on the same line. + +* Ternary operators that span a line should be parenthesized like as + "a ? (\n b ) : c". This is mainly to keep the indentation tools + happy. + +* Comments are always C-style /* */ block comments, with a leading * + each line. They should start with a capital letter and generally be + written in complete sentences. Public library functions are + documented immediately before their prototype in lib/notmuch.h. + Internal functions are typically documented immediately before their + definition. * Code lines should be less than 80 columns and comments should be wrapped at 70 columns. @@ -71,6 +79,10 @@ Naming * Use lowercase_with_underscores for function, variable, and type names. +* Except for variables with extremely small scope, and perhaps loop + indices, when naming variables and functions, err on the side of + verbosity. + * All structs should be typedef'd to a name ending with _t. If the struct has a tag, it should be the same as the typedef name, minus the trailing _t.