-
Notifications
You must be signed in to change notification settings - Fork 55
workflows: Add clang format check workflow. #143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Conversation
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds automated clang-format checking to the CI pipeline by cherry-picking configuration from the ArduinoCore-zephyr repository. The workflow will run on code changes to C/C++ files and enforce consistent code formatting across the project.
- Adds GitHub Actions workflow for automated clang-format validation
- Introduces comprehensive clang-format configuration based on LLVM style with Zephyr-specific customizations
- Configures format checking for specific project directories (cores/arduino, loader, libraries) with selective exclusions
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.github/workflows/format_check.yml |
New workflow that triggers format checks on C/C++ file changes using clang-format v19 across multiple project directories |
.clang-format |
Configuration file defining LLVM-based formatting rules with Zephyr macros, 100-column limit, and project-specific style preferences |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| exclude: 'examples' | ||
| exclude: 'extras' | ||
| exclude: 'ea_malloc' |
Copilot
AI
Dec 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The matrix configuration has duplicate 'exclude' keys. In YAML, when the same key appears multiple times at the same level, only the last value is retained. This means only 'ea_malloc' will be excluded, and the 'loader/llext_exports.c$' and 'examples' exclusions will be ignored. These should be combined into a single exclude pattern using regex alternation, or the matrix structure should be redesigned to support multiple exclusions per path.
| exclude: 'examples' | |
| exclude: 'extras' | |
| exclude: 'ea_malloc' | |
| exclude: 'examples|extras|ea_malloc' |
| workflow_dispatch: | ||
| inputs: | ||
| logLevel: | ||
| description: 'Log level' |
Copilot
AI
Dec 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is trailing whitespace after 'Log level' on this line. This should be removed to maintain consistent code formatting.
| description: 'Log level' | |
| description: 'Log level' |
Cherry-pick the commit adding .clang-format from https://github.com/arduino/ArduinoCore-zephyr.