Skip to content

Latest commit

 

History

History
38 lines (27 loc) · 542 Bytes

oelint.task.noanonpython.md

File metadata and controls

38 lines (27 loc) · 542 Bytes

oelint.task.noanonpython

severity: warning

Example

python __anonymous() {
    print("foo")
}

or

python () {
    print("bar")
}

Why is this bad?

Anonymous python functions are run every time the recipe is parsed. This is expensive in terms of computing. In addition, as the functions are run last in the parsing process, they can be full of side-effects and are hard to debug.

Ways to fix it

Turn into a separate function

python do_mytask() {
    print("foo")
}

addtask do_mytask before configure