Handle zephyr module generation#457
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
There was a problem hiding this comment.
Pull request overview
Adds an opt-in --zephyr/-z generation mode to emit Zephyr module scaffolding (module.yml, Kconfig, CMakeLists.txt, sources.cmake) from clayer metadata and cbuild pack/component information, addressing devtools issue #2429.
Changes:
- Add
--zephyr/-zCLI flag and route generation throughMaker.GenerateZephyrModules(). - Introduce clayer parsing (
ParseClayerFile(s)) and a Zephyr module generator (pkg/maker/zephyr.go) with unit tests. - Add small utility helpers (
ExtractPackIdParts,CopyFile) and extend identifier normalization withReplaceSpecialChars.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/utils/utils.go | Adds pack-id parsing helper and a simple file copy helper used by Zephyr generation. |
| pkg/utils/utils_test.go | Adds tests for new utils helpers. |
| pkg/maker/zephyr.go | Implements Zephyr module generation (module.yml, Kconfig, CMakeLists, sources.cmake) and file-path rewriting. |
| pkg/maker/zephyr_test.go | Adds focused unit tests for Zephyr generation outputs and path rewriting. |
| pkg/maker/parser.go | Adds clayer YAML model + parsing routines and extends cbuild-idx model to include clayers. |
| pkg/maker/maker.go | Adds Options.Zephyr and short-circuits standard generation when enabled. |
| pkg/maker/buildcontent.go | Adds ReplaceSpecialChars variant for identifiers that may include -. |
| pkg/maker/buildcontent_test.go | Adds unit tests for ReplaceSpecialChars. |
| cmd/cbuild2cmake/commands/root.go | Wires the --zephyr/-z flag into CLI options. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Coverage Impact ⬆️ Merging this pull request will increase total coverage on Modified Files with Diff Coverage (6)
🤖 Increase coverage with AI coding...🚦 See full report on Qlty Cloud » 🛟 Help
|

Fixes
Changes
--zephyr, -zoption for generation of zephyr modules from clayer components infoChecklist