From:  Jason Orendorff <jorendorff@mozilla.com>
Date:  11 May 2016 10:15:23 Hong Kong Time
Newsgroup:  news.mozilla.org/mozilla.dev.tech.js-engine.internals
Subject:  

Re: Clang-format

NNTP-Posting-Host:  63.245.214.181

On Fri, May 6, 2016 at 1:07 PM, Jakob Stoklund Olesen 
wrote:

> On May 6, 2016, at 09:59, Jason Orendorff  wrote:
>
> On Fri, May 6, 2016 at 10:43 AM, Jakob Stoklund Olesen <
> jolesen@mozilla.com> wrote:
>
>> Unfortunately, the way SpiderMonkey indents case labels is too odd for
>> clang-format. I don’t think it has a configuration flag that can do that
>> half-indent.
>
>
> Feel free to mass-change it to whatever Gecko does and update the style
> guide. We'll cope.
>
>
> The mozilla style is to indent the case label by one level from the
> switch, and the code inside the case by one further level. With 4-space
> indent, it looks like this:
>
>     switch (tag) {
>         case SCRIPT_INT: {
>             uint32_t i;
>             if (mode == XDR_ENCODE)
>                 i = uint32_t(vp.toInt32());
>

That looks pretty great to me.

I think that if we can cope with such an invasive mass change, we should
> instead go with Terrence’s suggestion and simply adopt the same style as
> the rest of Gecko, including the 2-space indent.
>

I've said before that we won't do this without talking it over as a team.
Well, team? What do you think?

Personally I dislike the 2-space indent. But what matters to me here is
eliminating a speed bump for both Gecko and SM hackers; and reducing
pointless arguments on dev.platform. Whether or not I personally like the
style is not even close to being on that list.

-j