Skip to content

Conversation

@soburi
Copy link
Member

@soburi soburi commented Dec 20, 2025

Cherry-pick the commit adding .clang-format from https://github.com/arduino/ArduinoCore-zephyr.

Copilot AI review requested due to automatic review settings December 20, 2025 09:20
Copy link

Copilot AI left a 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.

Comment on lines +45 to +47
exclude: 'examples'
exclude: 'extras'
exclude: 'ea_malloc'
Copy link

Copilot AI Dec 20, 2025

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.

Suggested change
exclude: 'examples'
exclude: 'extras'
exclude: 'ea_malloc'
exclude: 'examples|extras|ea_malloc'

Copilot uses AI. Check for mistakes.
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
Copy link

Copilot AI Dec 20, 2025

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.

Suggested change
description: 'Log level'
description: 'Log level'

Copilot uses AI. Check for mistakes.
Copy link
Member

@DhruvaG2000 DhruvaG2000 left a comment

Choose a reason for hiding this comment

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

I know this is just a cherrypick, but it would still be better if you added your SoB, since you are the one cherrypicking it to this project.
Also amend the commit body to contain something useful and resolve the github copilot review issues.
Thanks!

- check: 'cores/arduino/'
exclude: 'cores/arduino/api/'
- check: 'loader/'
exclude: 'loader/llext_exports\.c$'
Copy link
Member

Choose a reason for hiding this comment

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

These folders don't exist in this project, cleanup to remove irrelevant stuff.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this will be added as the integration with the Arduino repository progresses, so I would like to leave it as it is as long as it doesn't cause any errors.

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.

3 participants