Skip to content

Check bitbake recipes with linter

Dmitry Petrov requested to merge bb-recipe-linter into master

This is a fix for issue [746-001040] Add oelint-adv linting as layer commit check

We've introduced a new CI job which checks bitbake recipes added/updated in MR using the oelint-adv tool (https://github.com/priv-kweihmann/oelint-adv).

Herewith rules for linter checking are in .oelint.json rulefile, which is created with the command "oelint-adv --print-rulefile". It contains default rules for now, but will probably be customized later. It can be also used by developers during work on recipes.

During work on this MR, the main question for us was how to get the list of changed files in MR to check by linter. And decided to adjus the GIT_DEPTH variable, the new value for which is 50. This should be fine for getting all commits in MR, and still small enough to keep checkout fast for large projects. We also considered an alternative solution - to use GitLab API to receive all commits for particular MR, but it also has some limitations (except for bigger amount of work to implement in CI):

The linter tool is installed in the "before_script" step, but it should be integrated into the docker image. For this, we have prepared another MR: ci-images!34 (merged). When it is merged, we will adjust the current MR: remove the "before_script" step and will update CI_IMAGES_REVISION variable.

Example of output produced by the CI job: https://git.seco.com/seco-ne/yocto/layers/meta-seconorth-distro/-/jobs/799189

Edited by Dmitry Petrov

Merge request reports