简体   繁体   中英

Why can't I use ament_cpplint with cpplint plugins for various IDEs?

I am working with C++ code with ROS2. ROS2 has code style standards and one of the recommended linters is ament_cpplint, which is slightly different from cpplint

Most IDEs/Editors for C++ (Clion, Atom, VS Code, Sublime Text) have plugins for cpplint which will run periodic linter checks as you are editing files. You usually have to set the path to the cpplint executable on your computer. I've tried to set the path to ament_cpplint executable instead but it just won't work. I've tried this with multiple IDEs and plugins by now and none of them will work.

I am not sure what's causing this, Google's cpplint works with IDEs. And I can run $ ament_cpplint from the command line just fine, but I can't get it to work in an IDE.

This might be too late for you, but for others.

You need to pass the path to the cpplint.py executable that is inside the ament_cpplint package.

For ros2 galactic, it is located here:
/opt/ros/galactic/lib/python3.8/site-packages/ament_cpplint/cpplint.py

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM