This post is special, in the sense that it marks an important event in my life as a software developer.
But let's start from the beginning...
oelint-adv
When you use bitbake/YOCTO on a frequent basis, you might have are checked out my linting tool for these file called oelint-adv.
This tool parses bitbake file and checks for several rules and best practices when it comes to working within this ecosystem.
This tool parses bitbake file and checks for several rules and best practices when it comes to working within this ecosystem.
Initially I thought about using the original bitbake parser, which is available as open source licensed under GPL-2.0 - Unfortunately it requires more or less a whole workspace setup, including all layers a.s.o.
As this was meant as a quick check tool to be used in CI or git pre-commit hooks, I was pretty sure that this wouldn't work, so I wrote my own parser for bitbake files, till then exclusively used with the linting tool.
Scancode-toolkit
All of a sudden, I got a few weeks back a ticket on my GitHub repo that somebody else had more or less the same issue - they wanted to parse single bitbake files, extract some information and use it for their very own purposes.
This tool is called scancode-toolkit, a wonderful tool to scan source code for licensing information.
And yeah I have to admit, I myself had a ticket to implement it into the meta-sca layer and rejected the idea after seeing the large amount of python dependencies it would inherit.
This tool is called scancode-toolkit, a wonderful tool to scan source code for licensing information.
And yeah I have to admit, I myself had a ticket to implement it into the meta-sca layer and rejected the idea after seeing the large amount of python dependencies it would inherit.
Funny side of the story my parser will be soon part of these dependencies, because nexB asked if my parser from the linter can be moved to an extra library, ready to use for you own bitbake automation.
Enter: oelint-parser
For me that was also a welcome opportunity to do some refactoring to the parser sources.
The result of that can now the found on GitHub and PyPi.
The result of that can now the found on GitHub and PyPi.
On a side note
As this is more or less my first public python API, it was time to think about something like API documentation.
Luckily I stumbled upon the wonderful tool pydoc-markdown, which generates wonderful markdown documents out of python docstrings.
As I already commented almost all of my code with them it was easy to generate a API documentation in markdown, which you can view directly in your browser over at GitHub.
Luckily I stumbled upon the wonderful tool pydoc-markdown, which generates wonderful markdown documents out of python docstrings.
As I already commented almost all of my code with them it was easy to generate a API documentation in markdown, which you can view directly in your browser over at GitHub.
In case you want to reuse this for your own documentation, be sure to check the following files
But, hey, what's in it for me...?
With the parser being now available as a lib on its own, you can create your own automation for bitbake files, by wrapping the parser code with your own automation, just check this quick introduction.
Be sure to give it a try, I'm sure the possibilities are endless.
Feel free to contact my any time, if you face problems or want to discuss ideas - I would love to hear them.
Feel free to contact my any time, if you face problems or want to discuss ideas - I would love to hear them.
And now...
Please all start using
Kommentare
Kommentar veröffentlichen