Code style?
Kenth Eriksson
Kenth.Eriksson at infinera.com
Wed Jun 12 12:59:12 CEST 2019
On Tue, 2019-06-11 at 16:15 +0200, Maria Jan Matejka wrote:
> On 6/11/19 3:49 PM, Ondrej Zajicek wrote:
> > On Tue, Jun 11, 2019 at 01:37:42PM +0000, Kenth Eriksson wrote:
> >> Is there a code style guide to be used when submitting patches to
> bird?
> >> An emacs file, clang-format or similar would be useful.
> >
> > Hi
> >
> > Well, historically different parts of BIRD used different coding
> styles,
> > now we try to converge on 2 columns per indentation, Allman style
> > (opening brace on new line). Canonical way to indent to X-th column
> is
> > by X/8 tabs and X%8 spaces.
> >
> > For EMACS, it is:
> >
> > (setq-default c-default-style "bsd")
> > (setq-default c-basic-offset 2)
>
> Even currently different parts of BIRD use different coding styles
> as I can't get used to Allman or EMACS when writing completely new
> code.
> So parts of BIRD are still being written in (something like) Linux
> kernel style
> with 2 columns per indentation.
>
Please include somtething in your project that defines how you want
indentation to look. My patch with an emacs dir-locals.el was a just a
suggestion.
> The main rule is to use the same style as the file uses around the
> new code.
> Yes, it's somehow a mess, we know; we won't do much about that.
>
> Maria
More information about the Bird-users
mailing list