Re: Recipe Grep'ing


Robert Joslyn
 

On Wed, 2021-05-05 at 17:50 -0700, Khem Raj wrote:


On 5/5/21 5:41 PM, Chuck Wolber wrote:
I was pondering putting some work in to a fairly large patch set
aimed
at making recipes easier to grep through, and wanted to get some
feedback before I put time and effort into it.

"what" and the "why" when grep'ing through recipes to search for
things:

FOO += "item1"
FOO += "item2"

Whereas this pattern gives us the "what", but not the "why":

FOO = "item1 \
              item2 \
             "

After discussing this with Richard Purdie on IRC, I also understand
that
the latter pattern benefits some forms of build output. In addition,
for
SRC_URI, the "why" is normally fairly obvious from context clues.

So, is there any interest in accepting a patch set of that nature for
Yocto and OE repositories? If so, what variables and situations
should
be considered "off limits" to a change like that?
nice to have a linter, which can do such checks and perhaps we can
enable this in autobuilders so we can keep such cleansups maintained
There is the oe-stylize.py script that attempts to format recipes
according to the style guide:
https://git.openembedded.org/meta-openembedded/tree/contrib/oe-stylize.py

Last time I played with it, I was a bit disappointed with some of the
changes it makes, some of which are different than what devtool does.
When I need to introduce new developers to bitbake, I'd love to be able
to hand them oe-stylize or something similar and just tell them to run
it before committing to make sure everything is formatted consistently.

I've had updating oe-stylize.py on my TODO list for a while, but more
important things always come up.

Robert

Join yocto@lists.yoctoproject.org to automatically receive all group messages.