ros2 / rmw_zenoh

RMW for ROS 2 using Zenoh as the middleware
Apache License 2.0
197 stars 34 forks source link

[Feature request] Introduce `clang_format` and `clang_tidy` #253

Closed YuanYuYuan closed 2 months ago

YuanYuYuan commented 2 months ago

While porting rmw_zenoh to 1.0, it's sometimes hard to align the code style since cpplint doesn't provide a reformat/inplace option like ament_uncrustify. It would be nice to adapt the modern solutions like the linter clang_tidy and the formatter clang_format as we do in our zenoh c/cpp projects and as moveit do in their project. These checks can easily integrated with the editor and into the CI. If you think it's a good idea, I'm happy to make a PR for it. :smiley:

clalancette commented 2 months ago

It would be nice to adapt the modern solutions like the linter clang_tidy and the formatter clang_format

I'd really rather not. The goal here is to make rmw_zenoh part of the main ROS 2 core, and there we use both cpplint and uncrustify.

That said, in my experience if you use the --reformat option with cpplint, that gets you 90% of the way to making it compliant with cpplint.