You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Does open-code-review support BSP / low-level C code review? #1243
Not a maintainer, but I dug through the source to answer this factually rather than guess.
Will it review your files at all? Yes.
The extension allowlist (internal/config/allowlist/supported_file_types.json, 111 entries) includes .c, .h, .cpp, .cc, .cxx, .hpp and .hxx. So ordinary BSP sources go through.
Worth knowing what is not there, since a BSP tree is usually full of them: .s/.S (assembly), .dts/.dtsi (device tree), .ld (linker scripts), .mk/Kbuild/Kconfig. Those get dropped with ExcludeExtension at internal/scan/agent.go:513. You can admit them anyway with an explicit include glob, which is checked before the allowlist — see the comment at internal/scan/agent.go:507 and #371. In .opencodereview/rule.json:
{ "include": ["**/*.{c,h,S,dts,dtsi}"] }
Are there kernel/driver-specific rules? No.
There are 52 per-language rule docs in internal/config/rules/rule_docs/, including c.md and cpp.md, but they are general-purpose C. c.md covers things like malloc/free pairing, double-free, NULLing after free, and typos in declarations. Useful in a driver, but it is ordinary userspace-C advice.
Nothing targets what actually bites in BSP work: ISR context rules, sleeping in atomic context, DMA coherency and cache maintenance, MMIO ordering and barriers, endianness on register access, copy_from_user validation, IRQ-safe locking, or device-tree binding correctness. There is a vhdl.md, so hardware-adjacent languages are not off-limits in principle — there is just no kernel rule set today.
What I would do in your position
Project rules are the supported way to add domain knowledge — .opencodereview/rule.json with merge_system_rule so your BSP rules sit alongside the built-in C ones rather than replacing them (that flag is documented in #1133). A short rule file covering your driver conventions will likely outperform the generic C rules for this codebase.
Take the "no kernel rules" part as a reading of the tree at today's main, not an official answer — a maintainer may have plans I cannot see from the source.
Activity
wu21-web commentedon Sep 14, 2026
Please mention this as a sub-issue in #470
basil-k-aji-dev commentedon Sep 14, 2026
Not a maintainer, but I dug through the source to answer this factually rather than guess.
Will it review your files at all? Yes.
The extension allowlist (
internal/config/allowlist/supported_file_types.json, 111 entries) includes.c,.h,.cpp,.cc,.cxx,.hppand.hxx. So ordinary BSP sources go through.Worth knowing what is not there, since a BSP tree is usually full of them:
.s/.S(assembly),.dts/.dtsi(device tree),.ld(linker scripts),.mk/Kbuild/Kconfig. Those get dropped withExcludeExtensionatinternal/scan/agent.go:513. You can admit them anyway with an explicit include glob, which is checked before the allowlist — see the comment atinternal/scan/agent.go:507and #371. In.opencodereview/rule.json:{ "include": ["**/*.{c,h,S,dts,dtsi}"] }Are there kernel/driver-specific rules? No.
There are 52 per-language rule docs in
internal/config/rules/rule_docs/, includingc.mdandcpp.md, but they are general-purpose C.c.mdcovers things like malloc/free pairing, double-free, NULLing after free, and typos in declarations. Useful in a driver, but it is ordinary userspace-C advice.Nothing targets what actually bites in BSP work: ISR context rules, sleeping in atomic context, DMA coherency and cache maintenance, MMIO ordering and barriers, endianness on register access,
copy_from_uservalidation, IRQ-safe locking, or device-tree binding correctness. There is avhdl.md, so hardware-adjacent languages are not off-limits in principle — there is just no kernel rule set today.What I would do in your position
Project rules are the supported way to add domain knowledge —
.opencodereview/rule.jsonwithmerge_system_ruleso your BSP rules sit alongside the built-in C ones rather than replacing them (that flag is documented in #1133). A short rule file covering your driver conventions will likely outperform the generic C rules for this codebase.Take the "no kernel rules" part as a reading of the tree at today's
main, not an official answer — a maintainer may have plans I cannot see from the source.