Clang Format for Ruby


I am from the Ruby core team and I want to propose to everyone on that
project that we use clang format.

I'm trying to get a configuration which is consistent but also tries
to follow the existing conventions.

At this time, I'm stuck on trying to get this relatively common format:

static struct dwarf_section *
obj_dwarf_section_at(obj_info_t *obj, int n)
    struct dwarf_section *ary = {
    if (n < 0 || DWARF_SECTION_COUNT <= n) {
    return ary[n];

The trailing curly brace on the ary initialization always wants to go
on the previous line, i.e. after `debug_str`.

I'd like to try and retain the curly brace being on a line by itself
because it's the prevailing convention of the source code.

I couldn't find an option to do this.

Any help would be most welcome!


Not that this is the perfect solution, but is it acceptable to you
that you have a trailing comma after the last array element? I think
the curly brace will be placed on the next line in that case.