Skip to content

Conversation

@bburda
Copy link
Collaborator

@bburda bburda commented Nov 30, 2025

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

  • Bug fix
  • New feature or tests
  • Breaking change
  • Documentation only

Testing

colcon test


Checklist

  • Breaking changes are clearly described (and announced in docs / changelog if needed)
  • Tests were added or updated if needed
  • Docs were updated if behavior or public API changed

- 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
@bburda bburda requested review from Copilot and mfaferek93 November 30, 2025 16:17
@bburda bburda self-assigned this Nov 30, 2025
@bburda bburda added the enhancement New feature or request label Nov 30, 2025
mfaferek93
mfaferek93 previously approved these changes Nov 30, 2025
Copy link
Collaborator

@mfaferek93 mfaferek93 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

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 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-format and .clang-tidy configuration 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)
@bburda bburda force-pushed the feat/add-clang-format branch from eae0cdb to 5da564b Compare November 30, 2025 16:38
@mfaferek93 mfaferek93 self-requested a review November 30, 2025 16:44
@bburda bburda merged commit c860f50 into main Nov 30, 2025
3 checks passed
@bburda bburda deleted the feat/add-clang-format branch November 30, 2025 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add clang-format and clang-tidy

2 participants