priv-kweihmann / oelint-adv

Advanced oelint
BSD 2-Clause "Simplified" License
53 stars 27 forks source link

Suggest usage of += over :append #566

Open jo-so-nx opened 2 months ago

jo-so-nx commented 2 months ago

The bug report Review and remove unnecessary uses of _prepend/_append says

These postponed/lazy operations should only used when necessary, so +=/=+/.=/=. should be preferred for non-conditional operations.

Maybe this could become a info message.

This somewhat contradicts oelint.vars.appendop, but maybe it's possible to distinguish these cases.

There's currently a patch in discussion: https://lists.openembedded.org/g/openembedded-core/message/198154

priv-kweihmann commented 2 months ago

The question is what is necessary? ;-) If you know all of the stack, including locally injected classes and bbappends then that might be something to pull off.

But from this tool's perspective not everything is known, so I'd rather prefer not to do anything about it. Esp when even upstream is not keeping that up.

In the end this would have a lot of potential for false negatives, if the patched recipe is used in a wider context.

So I'm not really fond of implementing it, but I'll keep the ticket open, maybe with the 20th anniversary of the original bug report (2012-08-16 01:37 UTC) there's finally something to properly check for