-
Notifications
You must be signed in to change notification settings - Fork 2
[#47] Add clang-format and clang-tidy #49
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
Conversation
- Add .clang-format with Google-based style (2-space indent, custom braces) - Add .clang-tidy with curated checks (performance, modernize, readability) - Update CI workflow to install clang tools and run linters separately - Add ament_cmake_clang_format and ament_cmake_clang_tidy dependencies
mfaferek93
left a comment
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.
LGTM!
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 pull request adds clang-format and clang-tidy tooling to the ROS 2 Medkit Gateway project and reformats all C++ source files according to the new coding standards. The changes introduce automated code formatting and static analysis to improve code quality and consistency.
Key changes:
- Added
.clang-formatand.clang-tidyconfiguration files based on Google style with customizations - Reformatted all C++ source and header files with consistent brace placement, indentation, and line wrapping
- Updated build configuration to export compile commands for clang-tidy integration
- Modified CI workflow to run linters separately from unit/integration tests
- Added clang-format and clang-tidy as test dependencies
Reviewed changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
.clang-format |
New clang-format configuration based on Google style with 120 char line limit and custom brace wrapping |
.clang-tidy |
New clang-tidy configuration enabling performance, modernization, and readability checks |
src/ros2_medkit_gateway/CMakeLists.txt |
Added CMAKE_EXPORT_COMPILE_COMMANDS and configured clang-format/clang-tidy paths |
src/ros2_medkit_gateway/package.xml |
Updated test dependencies to use ament_cmake_clang_format and ament_cmake_clang_tidy |
.github/workflows/ci.yml |
Split test execution into separate linter and unit test steps, added clang-format/clang-tidy installation |
.devcontainer/Dockerfile |
Added clang-tidy to development container |
| All C++ files | Reformatted with clang-format: braces on separate lines, consistent indentation, updated include order |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Reformat all C++ files using custom .clang-format config - Fix performance-inefficient-string-concatenation warnings - Configure CMakeLists.txt to use custom clang-format/clang-tidy configs - Exclude cpplint (conflicts with clang-format include order)
eae0cdb to
5da564b
Compare
Pull Request
Summary
Add clang format and clang tidy to the project.
Reformat all C++ files.
Fix clang tidy warnings.
Issue
Link the related issue (required):
Type
Testing
colcon test
Checklist