Re: Clarification for source code formatting around jump labels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/04/2016 03:50 PM, SF Markus Elfring wrote:
I am just curious on how much further software development "fun" the recent update
by a topic like "CodingStyle: Clarify and complete chapter 7" will trigger.

I don't want to drag this thread onwards for (way) too long, but clearly "it is
advised to indent labels with a single space (not tab)" (from diff in above commit)

How do you think about the reason (which you omitted from your quotation) for this advice?

“…,
so that "diff -p" does not confuse labels with functions.
…”

Yep, since this recently came up in a different thread as well, please
see here, for example:

  http://patchwork.ozlabs.org/patch/664966/

doesn't really reflect the majority of kernel practice we have in-tree today and
actually rather adds more confusion than any clarification whatsoever:

   $ git grep -n "^\ [a-z_]*:" -- '*.[ch]' | wc -l
   4919
   $ git grep -n "^[a-z_]*:" -- '*.[ch]' | wc -l
   54686

So there is a mixture already.

[...]
In which ways would you prefer that the style specifications should be
clarified further?

Where should source code become more consistent?

It would likely make sense to document that git config mentioned in the
link above as a recommendation for that paragraph, and stick with what
is used in the vast majority of cases already, meaning no leading space
before labels.
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux