On 08/14/2013 09:31 AM, Joe MacDonald wrote:
[Re: [OE-core] recipe whitespace style questions] On 13.08.14 (Wed 16:13) 
Martin Jansa wrote:

On Wed, Aug 14, 2013 at 08:51:40AM -0500, Peter A. Bigot wrote:
SRC_URI = "file://skeleton \
             file://skeleton_test.c \
             file://COPYRIGHT \
"

which I'll call "none", and;

SRC_URI = "file://skeleton \
             file://skeleton_test.c \
             file://COPYRIGHT"

which I'll call "joined".

Again, for consistency's sake it would be nice to have a
recommendation.  I personally prefer "none", which matches the closing
bracket style for functions.

Next: I've also seen:

SRC_URI = " \
      file://skeleton \
      file://skeleton_test.c \
      file://COPYRIGHT \
"
I prefer this one (especially for longer variables or entries) or "none",
because with "none" it's easier to see where multiline variable ends.

Worst is IMHO "joined" because when appending one more line you have to
edit 2 lines to move '"' so the diff for review is longer and harder to
read than just one added line.
+1

To close this out: that's three votes for the style named "none" or the one with separated lines. No objections raised.

I'd thought the style guide was part of the Yocto documentation so I could prepare a patch to it, but it appears to only exist (independently) on the Yocto (https://wiki.yoctoproject.org/wiki/Recipe_%26_Patch_Style_Guide) and OpenEmbedded (http://www.openembedded.org/wiki/Styleguide) wiki sites.

In lieu of my applying for accounts on those sites and updating them I'll leave it that I think these additions would document the conclusions of this discussion, and are what I'll try to follow in my own Yocto-based recipe development:

* Multiple-line continuations should be indented to the level of the content following the introductory quote symbol on the first line.

* Alternatively, the first line of a multi-line value may be continued after the introductory quote symbol, with all subsequent content lines indented four spaces (or one tab if within a shell function)

* Any closing quote of a multiple-line continuation should be placed at the indentation level of the first continued line.

Peter
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to