Skip to content

Conversation

@deribaucourt
Copy link
Contributor

Hi,

BitBake is the language of [the Yocto Project(https://www.yoctoproject.org/)], the leading technology used to create Linux
distributions for embedded systems.

This PR is split into several commits:

  1. Adds the specific extensions and comment pattern
  2. Adds the tests on a hello world file
  3. Then it gets more tricky, because a lot of bitbake files use .inc and .conf
  4. I followed the pattern to distinguish files with these extensions thanks to idiomatic markers against other languages
  5. Adds tests for disambiguation. The "Unknown" alternative for .conf is a bit tricky to test. cloc returns 0 (success), but doesn't produce a results.yaml file

Let me know if you have any comments :)

I greatly appreciate this tool, and I'm looking forward to having BitBake support. I use it mostly to get statistics on projects complexity.

BitBake is the language of the Yocto Project, used to create Linux
distributions for embedded systems.
Add the hello recipe from meta-skeleton and ensure it is properly
counted.
BitBake shares this extension with other languages. Add some logic
to distinguish them using idiomatic markers.
BitBake uses conf files for layers, local and machine specific
assignments. If we don't detect a BitBake marker, we leave it as unknown
(the previous behavior). The detector function uses the same markers as
PHP/Pascal/Fortran/Pawn/BitBake with a few added variables specific to
layer.conf: BBFILE* and LAYER*.
Add .inc and .conf files, shared with other languages to the test.
cloc should properly categorize and count them as BitBake.

I also ran the test with the pre-existing .inc files to make sure
the previous languages were still properly detected.

I added an "Unknown" test to distinguish the .conf extension.
@AlDanial AlDanial merged commit 5fe8ba5 into AlDanial:master Aug 26, 2025
1 check passed
@AlDanial
Copy link
Owner

Impressive, thanks!

AlDanial added a commit that referenced this pull request Aug 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants