Repository navigation
Set up clang-format in pre-commit - #76
Merged
Merged
Conversation
There was a problem hiding this comment.
🟢 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-formatpre-commit hook scoped to C and C++ files underfirmwares/. - 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.