Skip to content

Set up clang-format in pre-commit - #76

Merged
puddly merged 2 commits into
devfrom
puddly/clang-format
Oct 30, 2026
Merged

puddly merged 2 commits into
devfrom
puddly/clang-format

Conversation

@puddly

@puddly puddly commented Oct 30, 2026

Copy link
Copy Markdown
Member

We have a bit more C and C++ code now so it's better to format it automatically. The OpenThread config is reasonable for this project since we mostly follow it anyway.

Copilot AI balanced review requested due to automatic review settings October 30, 2026 16:04
@puddly
puddly merged commit b82229a into dev Oct 30, 2026
2 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are blocking approval of the firmware-formatting change.

No open issues 🎉

What changed in this PR

Adds automated C and C++ formatting for firmware code, using an OpenThread-style configuration to keep formatting consistent.

Changes:

  • Adds a pinned clang-format pre-commit hook scoped to C and C++ files under firmwares/.
  • Introduces a shared firmware formatting configuration.
  • Applies formatting-only changes to existing firmware sources and headers.
File Description
firmwares/​glue/​ziggurat_ncp.cpp Adjusts trailing-comment spacing.
firmwares/​glue/​ziggurat_glue.cpp Reformats calls and aligns declarations and assignments.
firmwares/​esp32-c6/​main/​esp_ziggurat_rcp.c Reformats the platform configuration initializer.
firmwares/​esp32-c6/​main/​esp_ot_config.h Reformats configuration macros and aligns initializer fields.
firmwares/​.clang-format Defines the shared OpenThread-style formatting rules.
.pre-commit-config.yaml Adds the firmware-scoped clang-format hook.

Review effort: Balanced

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