Giter VIP home page Giter VIP logo

ament_lint's People

Contributors

ahcorde avatar aprotyas avatar audrow avatar blast545 avatar clalancette avatar cottsay avatar dhood avatar dirk-thomas avatar emersonknapp avatar esteve avatar hidmic avatar jacobperron avatar jpsamper2009 avatar jshep1 avatar karsten1987 avatar kenji-miyake avatar marcoag avatar methyldragon avatar mikaelarguedas avatar mjcarroll avatar mm318 avatar nuclearsandwich avatar paudrow avatar rotu avatar sloretz avatar tfoote avatar tylerjw avatar wjwwood avatar yadunund avatar zflat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ament_lint's Issues

ament_uncrustify crash on uncrustify nonzero exit code

Ament uncrustify crashes on certain failure conditions with messy output and the eventual error message TypeError: 'int' object is not iterable

This is due to expecting invoke_uncrustify to return a list of files, though sometimes it returns an integer return code.

Further, the stack trace is omitted and the error message is duplicated in main.py (so you can't tell which subprocess call failed) and if there is any output from the failed subprocess, it is unclear what that output is.

output_files = invoke_uncrustify(
uncrustify_bin, input_files, args, language, temp_path, suffix)
all_output_files += output_files

The invocation of 'uncrustify' failed with error code 1: Command '['/usr/bin/uncrustify', '-c', '/opt/ros/master/install/lib/python3.8/site-packages/ament_uncrustify/configuration/ament_code_style.cfg', '-l', 'C', '--prefix', '/tmp/uncrustify_559rpet5', '--suffix', '.uncrustify', '/home/dan/Documents/ros_ouster_ws/build/ouster_msgs/CMakeFiles/3.16.3/CompilerIdC/CMakeCCompilerId.c', '/home/dan/Documents/ros_ouster_ws/build/ouster_msgs/rosidl_generator_c/ouster_msgs/msg/metadata.h', '/home/dan/Documents/ros_ouster_ws/build/ouster_msgs/rosidl_generator_c/ouster_msgs/msg/metadata__functions.c', '/home/dan/Documents/ros_ouster_ws/build/ouster_msgs/rosidl_generator_c/ouster_msgs/msg/metadata__functions.h', '/home/dan/Documents/ros_ouster_ws/build/ouster_msgs/rosidl_generator_c/ouster_msgs/msg/metadata__struct.h', '/home/dan/Documents/ros_ouster_ws/build/ouster_msgs/rosidl_generator_c/ouster_msgs/msg/metadata__type_support.h', '/home/dan/Documents/ros_ouster_ws/build/ouster_msgs/rosidl_generator_c/ouster_msgs/msg/rosidl_generator_c__visibility_control.h', '/home/dan/Documents/ros_ouster_ws/build/ouster_msgs/rosidl_generator_c/ouster_msgs/srv/get_metadata.h', '/home/dan/Documents/ros_ouster_ws/build/ouster_msgs/rosidl_generator_c/ouster_msgs/srv/get_metadata__functions.c', '/home/dan/Documents/ros_ouster_ws/build/ouster_msgs/rosidl_generator_c/ouster_msgs/srv/get_metadata__functions.h', '/home/dan/Documents/ros_ouster_ws/build/ouster_msgs/rosidl_generator_c/ouster_msgs/srv/get_metadata__struct.h', '/home/dan/Documents/ros_ouster_ws/build/ouster_msgs/rosidl_generator_c/ouster_msgs/srv/get_metadata__type_support.h', '/home/dan/Documents/ros_ouster_ws/build/ouster_msgs/rosidl_generator_py/ouster_msgs/_ouster_msgs_s.ep.rosidl_typesupport_c.c', '/home/dan/Documents/ros_ouster_ws/build/ouster_msgs/rosidl_generator_py/ouster_msgs/_ouster_msgs_s.ep.rosidl_typesupport_fastrtps_c.c', '/home/dan/Documents/ros_ouster_ws/build/ouster_msgs/rosidl_generator_py/ouster_msgs/_ouster_msgs_s.ep.rosidl_typesupport_introspection_c.c', '/home/dan/Documents/ros_ouster_ws/build/ouster_msgs/rosidl_generator_py/ouster_msgs/msg/_metadata_s.c', '/home/dan/Documents/ros_ouster_ws/build/ouster_msgs/rosidl_generator_py/ouster_msgs/srv/_get_metadata_s.c', '/home/dan/Documents/ros_ouster_ws/build/ouster_msgs/rosidl_typesupport_c/ouster_msgs/msg/rosidl_typesupport_c__visibility_control.h', '/home/dan/Documents/ros_ouster_ws/build/ouster_msgs/rosidl_typesupport_fastrtps_c/ouster_msgs/msg/metadata__rosidl_typesupport_fastrtps_c.h', '/home/dan/Documents/ros_ouster_ws/build/ouster_msgs/rosidl_typesupport_fastrtps_c/ouster_msgs/msg/rosidl_typesupport_fastrtps_c__visibility_control.h', '/home/dan/Documents/ros_ouster_ws/build/ouster_msgs/rosidl_typesupport_fastrtps_c/ouster_msgs/srv/get_metadata__rosidl_typesupport_fastrtps_c.h', '/home/dan/Documents/ros_ouster_ws/build/ouster_msgs/rosidl_typesupport_fastrtps_cpp/ouster_msgs/msg/rosidl_typesupport_fastrtps_cpp__visibility_control.h', '/home/dan/Documents/ros_ouster_ws/build/ouster_msgs/rosidl_typesupport_introspection_c/ouster_msgs/msg/metadata__rosidl_typesupport_introspection_c.h', '/home/dan/Documents/ros_ouster_ws/build/ouster_msgs/rosidl_typesupport_introspection_c/ouster_msgs/msg/metadata__type_support.c', '/home/dan/Documents/ros_ouster_ws/build/ouster_msgs/rosidl_typesupport_introspection_c/ouster_msgs/msg/rosidl_typesupport_introspection_c__visibility_control.h', '/home/dan/Documents/ros_ouster_ws/build/ouster_msgs/rosidl_typesupport_introspection_c/ouster_msgs/srv/get_metadata__rosidl_typesupport_introspection_c.h', '/home/dan/Documents/ros_ouster_ws/build/ouster_msgs/rosidl_typesupport_introspection_c/ouster_msgs/srv/get_metadata__type_support.c', '/home/dan/Documents/ros_ouster_ws/build/pcl_conversions/CMakeFiles/3.16.3/CompilerIdC/CMakeCCompilerId.c', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/CMakeFiles/3.16.3/CompilerIdC/CMakeCCompilerId.c', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_generator_c/pcl_msgs/msg/model_coefficients.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_generator_c/pcl_msgs/msg/model_coefficients__functions.c', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_generator_c/pcl_msgs/msg/model_coefficients__functions.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_generator_c/pcl_msgs/msg/model_coefficients__struct.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_generator_c/pcl_msgs/msg/model_coefficients__type_support.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_generator_c/pcl_msgs/msg/point_indices.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_generator_c/pcl_msgs/msg/point_indices__functions.c', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_generator_c/pcl_msgs/msg/point_indices__functions.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_generator_c/pcl_msgs/msg/point_indices__struct.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_generator_c/pcl_msgs/msg/point_indices__type_support.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_generator_c/pcl_msgs/msg/polygon_mesh.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_generator_c/pcl_msgs/msg/polygon_mesh__functions.c', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_generator_c/pcl_msgs/msg/polygon_mesh__functions.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_generator_c/pcl_msgs/msg/polygon_mesh__struct.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_generator_c/pcl_msgs/msg/polygon_mesh__type_support.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_generator_c/pcl_msgs/msg/rosidl_generator_c__visibility_control.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_generator_c/pcl_msgs/msg/vertices.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_generator_c/pcl_msgs/msg/vertices__functions.c', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_generator_c/pcl_msgs/msg/vertices__functions.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_generator_c/pcl_msgs/msg/vertices__struct.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_generator_c/pcl_msgs/msg/vertices__type_support.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_generator_c/pcl_msgs/srv/update_filename.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_generator_c/pcl_msgs/srv/update_filename__functions.c', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_generator_c/pcl_msgs/srv/update_filename__functions.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_generator_c/pcl_msgs/srv/update_filename__struct.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_generator_c/pcl_msgs/srv/update_filename__type_support.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_generator_py/pcl_msgs/_pcl_msgs_s.ep.rosidl_typesupport_c.c', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_generator_py/pcl_msgs/_pcl_msgs_s.ep.rosidl_typesupport_fastrtps_c.c', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_generator_py/pcl_msgs/_pcl_msgs_s.ep.rosidl_typesupport_introspection_c.c', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_generator_py/pcl_msgs/msg/_model_coefficients_s.c', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_generator_py/pcl_msgs/msg/_point_indices_s.c', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_generator_py/pcl_msgs/msg/_polygon_mesh_s.c', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_generator_py/pcl_msgs/msg/_vertices_s.c', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_generator_py/pcl_msgs/srv/_update_filename_s.c', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_typesupport_c/pcl_msgs/msg/rosidl_typesupport_c__visibility_control.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_typesupport_fastrtps_c/pcl_msgs/msg/model_coefficients__rosidl_typesupport_fastrtps_c.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_typesupport_fastrtps_c/pcl_msgs/msg/point_indices__rosidl_typesupport_fastrtps_c.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_typesupport_fastrtps_c/pcl_msgs/msg/polygon_mesh__rosidl_typesupport_fastrtps_c.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_typesupport_fastrtps_c/pcl_msgs/msg/rosidl_typesupport_fastrtps_c__visibility_control.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_typesupport_fastrtps_c/pcl_msgs/msg/vertices__rosidl_typesupport_fastrtps_c.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_typesupport_fastrtps_c/pcl_msgs/srv/update_filename__rosidl_typesupport_fastrtps_c.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_typesupport_fastrtps_cpp/pcl_msgs/msg/rosidl_typesupport_fastrtps_cpp__visibility_control.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_typesupport_introspection_c/pcl_msgs/msg/model_coefficients__rosidl_typesupport_introspection_c.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_typesupport_introspection_c/pcl_msgs/msg/model_coefficients__type_support.c', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_typesupport_introspection_c/pcl_msgs/msg/point_indices__rosidl_typesupport_introspection_c.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_typesupport_introspection_c/pcl_msgs/msg/point_indices__type_support.c', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_typesupport_introspection_c/pcl_msgs/msg/polygon_mesh__rosidl_typesupport_introspection_c.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_typesupport_introspection_c/pcl_msgs/msg/polygon_mesh__type_support.c', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_typesupport_introspection_c/pcl_msgs/msg/rosidl_typesupport_introspection_c__visibility_control.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_typesupport_introspection_c/pcl_msgs/msg/vertices__rosidl_typesupport_introspection_c.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_typesupport_introspection_c/pcl_msgs/msg/vertices__type_support.c', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_typesupport_introspection_c/pcl_msgs/srv/update_filename__rosidl_typesupport_introspection_c.h', '/home/dan/Documents/ros_ouster_ws/build/pcl_msgs/rosidl_typesupport_introspection_c/pcl_msgs/srv/update_filename__type_support.c', '/home/dan/Documents/ros_ouster_ws/build/perception_pcl/CMakeFiles/3.16.3/CompilerIdC/CMakeCCompilerId.c', '/home/dan/Documents/ros_ouster_ws/build/ros2_ouster/CMakeFiles/3.16.3/CompilerIdC/CMakeCCompilerId.c', '/home/dan/Documents/ros_ouster_ws/install/include/ouster_msgs/msg/metadata.h', '/home/dan/Documents/ros_ouster_ws/install/include/ouster_msgs/msg/metadata__functions.c', '/home/dan/Documents/ros_ouster_ws/install/include/ouster_msgs/msg/metadata__functions.h', '/home/dan/Documents/ros_ouster_ws/install/include/ouster_msgs/msg/metadata__rosidl_typesupport_fastrtps_c.h', '/home/dan/Documents/ros_ouster_ws/install/include/ouster_msgs/msg/metadata__rosidl_typesupport_introspection_c.h', '/home/dan/Documents/ros_ouster_ws/install/include/ouster_msgs/msg/metadata__struct.h', '/home/dan/Documents/ros_ouster_ws/install/include/ouster_msgs/msg/metadata__type_support.c', '/home/dan/Documents/ros_ouster_ws/install/include/ouster_msgs/msg/metadata__type_support.h', '/home/dan/Documents/ros_ouster_ws/install/include/ouster_msgs/msg/rosidl_generator_c__visibility_control.h', '/home/dan/Documents/ros_ouster_ws/install/include/ouster_msgs/msg/rosidl_typesupport_fastrtps_c__visibility_control.h', '/home/dan/Documents/ros_ouster_ws/install/include/ouster_msgs/msg/rosidl_typesupport_fastrtps_cpp__visibility_control.h', '/home/dan/Documents/ros_ouster_ws/install/include/ouster_msgs/msg/rosidl_typesupport_introspection_c__visibility_control.h', '/home/dan/Documents/ros_ouster_ws/install/include/ouster_msgs/srv/get_metadata.h', '/home/dan/Documents/ros_ouster_ws/install/include/ouster_msgs/srv/get_metadata__functions.c', '/home/dan/Documents/ros_ouster_ws/install/include/ouster_msgs/srv/get_metadata__functions.h', '/home/dan/Documents/ros_ouster_ws/install/include/ouster_msgs/srv/get_metadata__rosidl_typesupport_fastrtps_c.h', '/home/dan/Documents/ros_ouster_ws/install/include/ouster_msgs/srv/get_metadata__rosidl_typesupport_introspection_c.h', '/home/dan/Documents/ros_ouster_ws/install/include/ouster_msgs/srv/get_metadata__struct.h', '/home/dan/Documents/ros_ouster_ws/install/include/ouster_msgs/srv/get_metadata__type_support.c', '/home/dan/Documents/ros_ouster_ws/install/include/ouster_msgs/srv/get_metadata__type_support.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_conversions/pcl_conversions.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/model_coefficients.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/model_coefficients__functions.c', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/model_coefficients__functions.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/model_coefficients__rosidl_typesupport_fastrtps_c.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/model_coefficients__rosidl_typesupport_introspection_c.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/model_coefficients__struct.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/model_coefficients__type_support.c', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/model_coefficients__type_support.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/point_indices.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/point_indices__functions.c', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/point_indices__functions.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/point_indices__rosidl_typesupport_fastrtps_c.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/point_indices__rosidl_typesupport_introspection_c.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/point_indices__struct.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/point_indices__type_support.c', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/point_indices__type_support.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/polygon_mesh.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/polygon_mesh__functions.c', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/polygon_mesh__functions.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/polygon_mesh__rosidl_typesupport_fastrtps_c.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/polygon_mesh__rosidl_typesupport_introspection_c.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/polygon_mesh__struct.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/polygon_mesh__type_support.c', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/polygon_mesh__type_support.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/rosidl_generator_c__visibility_control.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/rosidl_typesupport_fastrtps_c__visibility_control.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/rosidl_typesupport_fastrtps_cpp__visibility_control.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/rosidl_typesupport_introspection_c__visibility_control.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/vertices.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/vertices__functions.c', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/vertices__functions.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/vertices__rosidl_typesupport_fastrtps_c.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/vertices__rosidl_typesupport_introspection_c.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/vertices__struct.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/vertices__type_support.c', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/msg/vertices__type_support.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/srv/update_filename.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/srv/update_filename__functions.c', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/srv/update_filename__functions.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/srv/update_filename__rosidl_typesupport_fastrtps_c.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/srv/update_filename__rosidl_typesupport_introspection_c.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/srv/update_filename__struct.h', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/srv/update_filename__type_support.c', '/home/dan/Documents/ros_ouster_ws/install/include/pcl_msgs/srv/update_filename__type_support.h', '/home/dan/Documents/ros_ouster_ws/install/lib/python3.8/site-packages/ouster_msgs/msg/_metadata_s.c', '/home/dan/Documents/ros_ouster_ws/install/lib/python3.8/site-packages/ouster_msgs/srv/_get_metadata_s.c', '/home/dan/Documents/ros_ouster_ws/install/lib/python3.8/site-packages/pcl_msgs/msg/_model_coefficients_s.c', '/home/dan/Documents/ros_ouster_ws/install/lib/python3.8/site-packages/pcl_msgs/msg/_point_indices_s.c', '/home/dan/Documents/ros_ouster_ws/install/lib/python3.8/site-packages/pcl_msgs/msg/_polygon_mesh_s.c', '/home/dan/Documents/ros_ouster_ws/install/lib/python3.8/site-packages/pcl_msgs/msg/_vertices_s.c', '/home/dan/Documents/ros_ouster_ws/install/lib/python3.8/site-packages/pcl_msgs/srv/_update_filename_s.c', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_conversions/include/pcl_conversions/pcl_conversions.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/pcl_nodelet.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/point_cloud.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/publisher.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/transforms.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/features/boundary.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/features/feature.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/features/fpfh.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/features/fpfh_omp.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/features/moment_invariants.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/features/normal_3d.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/features/normal_3d_omp.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/features/normal_3d_tbb.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/features/pfh.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/features/principal_curvatures.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/features/shot.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/features/shot_omp.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/features/vfh.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/filters/crop_box.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/filters/extract_indices.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/filters/filter.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/filters/passthrough.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/filters/project_inliers.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/filters/radius_outlier_removal.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/filters/statistical_outlier_removal.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/filters/voxel_grid.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/io/bag_io.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/io/concatenate_data.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/io/concatenate_fields.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/io/pcd_io.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/segmentation/extract_clusters.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/segmentation/extract_polygonal_prism_data.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/segmentation/sac_segmentation.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/segmentation/segment_differences.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/surface/convex_hull.h', '/home/dan/Documents/ros_ouster_ws/src/perception_pcl/pcl_ros/include/pcl_ros/surface/moving_least_squares.h']' returned non-zero exit status 1.
Traceback (most recent call last):
  File "/opt/ros/master/install/bin/ament_uncrustify", line 11, in <module>
    load_entry_point('ament-uncrustify==0.8.1', 'console_scripts', 'ament_uncrustify')()
  File "/opt/ros/master/install/lib/python3.8/site-packages/ament_uncrustify/main.py", line 130, in main
    all_output_files += output_files
TypeError: 'int' object is not iterable

The property "INCLUDE_DIRECTORIES" is not allowed.

When trying to compile rosbag2 with the latest ros2 master, I run into the following cmake error. I believe it's related to #117

Do we have to change something in the rosbag2 code base?

--- stderr: rosbag2_test_common
CMake Error at /root/ros2_ws/install/share/ament_cmake_cppcheck/cmake/ament_cmake_cppcheck_lint_hook.cmake:36 (get_property):
  INTERFACE_LIBRARY targets may only have whitelisted properties.  The
  property "INCLUDE_DIRECTORIES" is not allowed.
Call Stack (most recent call first):
  /root/ros2_ws/install/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:38 (include)
  /root/ros2_ws/install/share/ament_lint_auto/cmake/ament_lint_auto_package_hook.cmake:15 (ament_execute_extensions)
  /root/ros2_ws/install/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:38 (include)
  /root/ros2_ws/install/share/ament_cmake_core/cmake/core/ament_package.cmake:66 (ament_execute_extensions)
  CMakeLists.txt:43 (ament_package)

The rosbag2 code in question is relatively simple:
https://github.com/ros2/rosbag2/blob/master/rosbag2_test_common/CMakeLists.txt#L20-L41

  target_include_directories(${PROJECT_NAME} INTERFACE
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
    $<INSTALL_INTERFACE:include>)

When resetting ament_cmake_cppcheck to version 0.6.2 it compiles correctly.

Split up Python tools into Python and CMake packages

Right now packages like ament_pyflakes and ament_pep8 combine the CMake infrastructure and the pure Python tools which makes it difficult to use with other pure Python packages like ament_tools. So we need to split these packages up, like was done with ament_cmake_copyright and ament_copyright.

AC:

  • ament_cppcheck
  • ament_lint_cmake
  • ament_pep8
  • ament_pyflakes
  • ament_uncrustify
  • pure Python packages like ament_tools should use ament_pyflakes and ament_pep8 for linting: separate ticket: ament/ament_tools#22
  • CMake projects which currently use these tools updated

ament_cppcheck is failing with a KeyError on rmw_connext_cpp

The file exists, The report variable appears to not have been initialized properly.

line with error in traceback

Traceback (most recent call last):
  File "/home/rosbuild/ci_scripts/workspace/install/bin/ament_cppcheck", line 9, in <module>
    load_entry_point('ament-cppcheck==0.0.0', 'console_scripts', 'ament_cppcheck')()
  File "/home/rosbuild/ci_scripts/workspace/install/lib/python3.4/site-packages/ament_cppcheck-0.0.0-py3.4.egg/ament_cppcheck/main.py", line 115, in main
KeyError: 'src/functions.cpp'

Provide a way to suppress ament_pclint warnings

Currently, the warnings printed when pclint is not available can generate a lot of noise. It would be nice to have an option to tell CMake to not print this warning. Something like --cmake-args -DIGNORE_PCLINT=1 would tell ament_cmake_pclint to not print the warning

CMake Warning at <install-path>/share/ament_cmake_pclint/cmake/ament_pclint.cmake:117 (message):
  WARNING: pclp64_linux not found, skipping pclint test creation
Call Stack (most recent call first):
  CMakeLists.txt:39 (ament_pclint)

Add in support for the BSD license in the copyright linting

Some of the code that is coming into the codebase originally came from ROS1 with a BSD license. Since we are not making substantial changes to it, we can't really change the license (see ros2/common_interfaces@025b191#commitcomment-21888534 for a discussion on this).

However, we would like to lint these files. To do this, I think we'll have to add support for the BSD copyright into ament_lint. For an example of it failing, see: http://ci.ros2.org/job/ci_linux/2531/ , where the failing file is https://github.com/ros2/common_interfaces/blob/master/sensor_msgs/include/sensor_msgs/distortion_models.hpp

linters do not include package reference in errors

A test result like this is not particularly useful to browse the results and find the source code at issue. Often the name can be guessed by the duplicated package name in the path not always.

Example from copyright: http://54.183.26.131:8080/job/ros2_batch_ci/83/testReport/(root)/missing%20copyright/__test_test_type_py/

missing copyright../test/test_type.py (from copyright)

Failing for the past 3 builds (Since Failed#81 )
Took 0 ms.
add description
Stacktrace

could not find copyright reference

Example from clang_format: http://54.183.26.131:8080/job/ros2_batch_ci/83/testReport/(root)/replacement/__src_functions_cpp_15624/

replacement../src/functions.cpp:15624 (from clang_format)

Failing for the past 1 build (Since Unstable#83 )
Took 0 ms.
add description
Stacktrace

Replace 1 characters with []

ament_lint_common skipping ament_copyright when no source files

Found this bug when enabling ament_lint_common tests for the console_bridge_vendor package here.

In the CI results appears the results for the xmllintand lint_cmake tests. However, the test ament_copyright tests are not run. As this test also checks for the LICENSE and CONTRIBUTING.md files of the package, it should be running.

Running ament_copyright directly over the package folder shows the results of the test, so I think the ament_ lint_common at some point of the parsing of the required tests, skips this one in the absence of source files.

[ament_copyright] relax enforcement of Apache license in file header

ament_copyright is overzealous in enforcing its preferred header for Apache 2.0 license.

See http://www.apache.org/foundation/license-faq.html

  • Use of the license does not require this header - only if it's likely that the source files somehow become separated from the license file.
  • This check precludes the short variant suggested by Apache:
Copyright [yyyy] [name of copyright owner]
SPDX-License-Identifier: Apache-2.0

ament_test fails on ament_uncrustify

Description

Proposed solution

  • It is possible to hide this error by adding any test. For example, if you add a simple test_copyright.py, tests will pass.
  • Nevertheless, there seems to be some inconsistency where some packages are allowed to have zero tests while other packages fail on zero tests (for example, ament_lint_common will pass even though it has no tests.

ament_cppcheck fails to find file

Running cppcheck for the repository in https://github.com/ApexAI/velodyne_driver/tree/initial-checkin fails

I don't know what's going on, because the other packages pass just fine, but ament_cppcheck fails with only one package (velodyne_driver) with the following error:

Starting >>> lidar_utils
Starting >>> udp_driver
Finished <<< udp_driver [4.02s]                                           
Finished <<< lidar_utils [4.25s]          
Starting >>> velodyne_driver
--- stderr: velodyne_driver                   
Errors while running CTest
---
Finished <<< velodyne_driver [4.42s]    [ with test failures ]
Starting >>> velodyne_node
Finished <<< velodyne_node [3.58s]           

Summary: 4 packages finished [12.4s]
  1 package had stderr output: velodyne_driver
  1 package had test failures: velodyne_driver
../velodyne_driver_build/velodyne_driver/Testing/20190809-1420/Test.xml: 7 tests, 0 errors, 1 failure, 0 skipped
../velodyne_driver_build/velodyne_driver/test_results/velodyne_driver/cppcheck.xunit.xml: 1 test, 0 errors, 1 failure, 0 skipped
- velodyne_driver cppcheck.xunit.missing_result
  <<< failure message
    The test did not generate a result file:
    
    Traceback (most recent call last):
      File "/opt/ros/dashing/bin/ament_cppcheck", line 11, in <module>
        load_entry_point('ament-cppcheck==0.7.6', 'console_scripts', 'ament_cppcheck')()
      File "/opt/ros/dashing/lib/python3.6/site-packages/ament_cppcheck/main.py", line 164, in main
        report[filename].append(data)
    KeyError: '/home/esteve/velodyne_driver/velodyne_driver/include/velodyne_driver/vlp16_translator.hpp'
  >>>

Summary: 130 tests, 0 errors, 2 failures, 0 skipped

Is there anything in the directory structure of the repository that makes ament_cppcheck ?

Add HAROS integration ``ament_haros``

Hello!

A previous discussion to provide a integration package for the analysis tool HAROS ( https://github.com/git-afsantos/haros ) for catkin (haros_catkin https://github.com/rosin-project/haros_catkin )
spawned the suggestion by some people to provide the same for ROS2 in the form of a new ament_lint package.
The discussion is here: rosin-project/haros_catkin#24
and the development repository here: https://github.com/esol-community/ament_lint/tree/ament_haros
It's still waiting on some PRs to HAROS itself, so it's not ready for integration yet (although already fully functional),
but I would like to start the discussion about this integration here and get input from people.

Thanks so much for your time.
Best regards,
Max

ament flake8 does not ignore packages with AMENT/COLCON_IGNORE

Other ament linters will automatically filter out files from directories that have an AMENT_IGNORE: e.g.

Ideally, ament flake8 would be consistent with this behavior.

ament_copyright console_script entry point is not being installed on Windows

When building the ROS 2 repositories with --build-tests I get a failure on ament_cmake_copyright saying that the ament_copyright executable cannot be found. Indeed, it is not located in <install prefix>/bin.

I've ensured that I'm using the latest setuptools:

C:\dev\ros2
> python -c "import setuptools; print(setuptools.__version__)"
14.3

C:\dev\ros2
> python --version
Python 3.4.2

@dirk-thomas any ideas? I'll try to get a transcript of the ament_copyright and ament_cmake_copyright packages building and installing for you.

[ament_cppcheck] Unable to resolve macro definitions from includes

With the latest release of cppcheck (v1.86), tests have started failing in rclcpp with the following error message (or very similar):

There is an unknown macro here somewhere. Configuration is required. If RCLCPP_SMART_PTR_DEFINITIONS is a macro then please configure it.

Example build: https://ci.ros2.org/view/All/job/test_ci_osx/118/


I don't believe this is an error in rclcpp itself, but with how cppcheck is invoked.
If cppcheck is invoked with the -I option, passing the include directory, then the error goes away.
E.g.

cppcheck -I rclcpp/rclcpp/include  rclcpp/rclcpp/include/rclcpp/client.hpp

Documentation for the -I option:

    -I <dir>             Give path to search for include files. Give several -I
                         parameters to give several paths. First given path is
                         searched for contained header files first. If paths are
                         relative to source files, this is not needed.

Add QA tool to check for license in files

Before continuing the implementation we need to clarify the exact requirements. I would suggest to define a very strict structure which we will support. If a file does not follow that structure it won't be supported to process the file with ament_copyright.

AC:

  • Extend ament_copyright to assert that all code files have a proper license at the top.
  • Check that there is LICENSE in the root of the repo.
  • Check that there is CONTRIBUTING.md in the root of the repo.
  • Option to add missing license information.
  • Option to add current year to copyright notice in LICENSE file.

ament_uncrustify and ament_clang_format cannot both be satisfied

ament_uncrustify and ament_clang_format have defaults which differ in a way that you can't satisfy both at the same time. What's worse, ament_uncrustify --reformat will often make changes that cause ament_clang_format to complain and vice versa.

One of these tools should be deprecated or they should enforce compatible code formatting styles.

Formatted with ament_uncrustify --format:

#pragma once
#include "rclcpp/rclcpp.hpp"
namespace openrover
{
template<typename T>
struct Timestamped
{
  Timestamped(const rclcpp::Time & time, T state)
  : time(time), state(state) {}

  using State = T;
  rclcpp::Time time;
  T state;
};
}

formatted with ament_clang_format --reformat:

#pragma once
#include "rclcpp/rclcpp.hpp"
namespace openrover {
template <typename T>
struct Timestamped {
  Timestamped(const rclcpp::Time& time, T state) : time(time), state(state) {}

  using State = T;
  rclcpp::Time time;
  T state;
};
}  // namespace openrover

Allow excluding checkers from ament_lint_auto_find_test_dependencies

Motivation

  • As mentioned in ros2/rosbag2#86 (comment), it is possible to exclude specific checkers by setting <package>_FOUND to TRUE: e.g.
find_package(ament_lint_auto REQUIRED)
# Disable auto copyright
set(ament_cmake_copyright_FOUND TRUE)
# Disable auto cpplint
set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
  • However, if you still want to run the checkers (with a different configuration or on a subset of files, for example), the cmake code above becomes:
find_package(ament_lint_auto REQUIRED)
# Disable auto copyright
set(ament_cmake_copyright_FOUND TRUE)
# Disable auto cpplint
set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()

# Reenable copyright
set(ament_cmake_copyright_FOUND FALSE)
find_package(ament_cmake_copyright)
ament_copyright(${ONLY_SOME_FILES})

# Reenable cpplint
set(ament_cmake_cpplint_FOUND FALSE)
find_package(ament_cmake_cpplint_FOUND)
ament_cpplint(FILTERS "-readability/inheritance")
  • Adding and EXCLUDE option in ament_lint_auto_find_test_dependencies could make the code above cleaner: e.g.
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies(
  EXCLUDE
  ament_cmake_copyright
  ament_cmake_cpplint
)

find_package(ament_cmake_copyright)
ament_copyright(${ONLY_SOME_FILES})

find_package(ament_cmake_cpplint)
ament_cpplint(FILTERS "-readability/inheritance")
  • My thought is that we can basically move the set() commands into the macro

Goals

  • Simplify the CMakeLists.txt file of packages which have a checkers or files diverging from the default checkers
  • Make sure that new files are automatically checked, such that they need to be exclude explicitly
  • Make sure that new linters (e.g. xmllint) automatically get added

Relate issues

  • This feature request is similar to #119, with the difference that the goal here is not to turn off the checker, but to call the checker in a non-default way.

Open questions

  • If this feature were implemented, would it be accepted? Or is it adding unnecessary complexity to ament_lint_auto_find_test_dependencies?

Pytest warnings about unknown marks

Pytest for the linters has started emitting PytestUnknownMarkWarnings

I've started seeing these warnings in my development environment as well. Based on the error output, it seems that we can register the linter marks and stop these warnings.

Sample output from https://ci.ros2.org/job/ci_osx/6068/console

17:29:00 =============================== warnings summary ===============================
17:29:00 /Users/osrf/jenkins-agent/workspace/ci_osx/venv/lib/python3.7/site-packages/_pytest/mark/structures.py:337
17:29:00   /Users/osrf/jenkins-agent/workspace/ci_osx/venv/lib/python3.7/site-packages/_pytest/mark/structures.py:337: PytestUnknownMarkWarning: Unknown pytest.mark.copyright - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html
17:29:00     PytestUnknownMarkWarning,
17:29:00 
17:29:00 /Users/osrf/jenkins-agent/workspace/ci_osx/venv/lib/python3.7/site-packages/_pytest/mark/structures.py:337
17:29:00   /Users/osrf/jenkins-agent/workspace/ci_osx/venv/lib/python3.7/site-packages/_pytest/mark/structures.py:337: PytestUnknownMarkWarning: Unknown pytest.mark.linter - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html
17:29:00     PytestUnknownMarkWarning,
17:29:00 
17:29:00 /Users/osrf/jenkins-agent/workspace/ci_osx/venv/lib/python3.7/site-packages/_pytest/mark/structures.py:337
17:29:00   /Users/osrf/jenkins-agent/workspace/ci_osx/venv/lib/python3.7/site-packages/_pytest/mark/structures.py:337: PytestUnknownMarkWarning: Unknown pytest.mark.flake8 - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html
17:29:00     PytestUnknownMarkWarning,
17:29:00 
17:29:00 /Users/osrf/jenkins-agent/workspace/ci_osx/venv/lib/python3.7/site-packages/_pytest/mark/structures.py:337
17:29:00   /Users/osrf/jenkins-agent/workspace/ci_osx/venv/lib/python3.7/site-packages/_pytest/mark/structures.py:337: PytestUnknownMarkWarning: Unknown pytest.mark.pep257 - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html
17:29:00     PytestUnknownMarkWarning,

Unclear how to use ament_clang_tidy

Reading the documentation, I would assume

ament_clang_tidy --fix-errors

works like

ament_uncrustify --reformat src/

as in the source files in my workspace will be fixed in place.

However, I don't see any changes, and I'm not sure if the script errored out somewhere. It looks like it complained a lot about "stddef.h" and "gtest/gtest.h" not found and gave up.

The question is are there any prerequisite steps needed to be done before running ament_clang_tidy, like generating a compilation database (a compile_commands.json file) with colcon build --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ON, since that's how run-clang-tidy.py is typically used.

cpplint error when .git directory not present

On deleting the .git directory the repo, running cpplint will show
"#ifndef header guard has wrong style, please use: XXXX_XXX_AB...."
for any header file.
Is this a bug with cpplint or any ament tool ? Can it be fixed ?

Thanks!!

build/install directories also being checked

If I run the linter tests from the directory with the CMakeLists.txt, they start testing the files created during the build step. This makes the test 1) spit out a bunch of junk and 2) fail.

For example,

~/ros2_ws/src/ros2/rclpy/rclpy$ ament test . --ctest-args -L linter

yields

The following tests FAILED:
      2 - copyright (Failed)
      4 - cpplint (Failed)
      5 - lint_cmake (Failed)
      6 - pep257 (Failed)
      9 - uncrustify (Failed)

with errors such as

2: -- run_test.py: invoking following command in '/home/dhood/ros2_ws/src/ros2/rclpy/rclpy':
2:  - /home/dhood/ros2_ws/install_isolated/ament_copyright/bin/ament_copyright --xunit-file /home/dhood/ros2_ws/src/ros2/rclpy/rclpy/build/rclpy/test_results/rclpy/copyright.xunit.xml
2: build/rclpy/CMakeFiles/2.8.12.2/CMakeCCompiler.cmake: could not find copyright notice
2: build/rclpy/rclpy/__init__.py: could not find copyright notice

and

9: -- run_test.py: invoking following command in '/home/dhood/ros2_ws/src/ros2/rclpy/rclpy':
9:  - /home/dhood/ros2_ws/install_isolated/ament_uncrustify/bin/ament_uncrustify --xunit-file /home/dhood/ros2_ws/src/ros2/rclpy/rclpy/build/rclpy/test_results/rclpy/uncrustify.xunit.xml
9: Code style divergence in file 'build/rclpy/CMakeFiles/2.8.12.2/CompilerIdC/CMakeCCompilerId.c'

I can fix this by instead calling

~/ros2_ws/src/ros2/rclpy$ ament test rclpy --ctest-args -L linter

but I wanted to make a note of it as I don't feel like I'll be the only person who will ever try to do this, and it wasn't immediately obvious why my tests were failing.

No way to incrementally improve linters

As discovered when doing #174, the expectation of making linter changes is that, even when fixing linters to comply with documented coding standards, there is an expectation of wide-ranging PRs in parallel to accommodate these changes.

It seems we need a better path forward for linters already in use. Some discussion here: ros2/rclcpp#1052

Here are some suggested fixes:
(1) allow specifying a reference commit so style issues before that commit are grandfathered in, preventing code churn.
(2) version the coding standards so that packages have to affirmatively opt in to later refinements, and they don't automatically create CI regressions.

Make ament_copyright robust to newlines

It should be fairly straightforward to make ament_copyright deal with newlines in a more robust way, so that lines can be broken up in different ways in the copyright header in files.

ament_copyright failing to detect copyright in c style comment blocks

Checking this one package I found both files failing the copyright check have a copyright.

(r2) tfoote@yeti:~/work/r2/ros2_ws/src/ros2/rclc/rclc$ ament_copyright .
./include/rclc/rclc.h
./include/rclc/rclc.h: could not find copyright reference

./include/rclc/types.h
./include/rclc/types.h: could not find copyright reference

2 errors
(r2) tfoote@yeti:~/work/r2/ros2_ws/src/ros2/rclc/rclc$ head include/rclc/rclc.h 
/* Copyright 2014 Open Source Robotics Foundation, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,

consider restricting the content of "{company}" for BSD2 license third clause

Follow-up of #106

The current matching allow anything to be placed between Neither the name of and nor the names of its in the third clause.

This is too permissive to our taste.

Options to consider:

  • use OSI template and don't allow any name in the third clause, use the generic copyright holder instead
  • restrict the content of the {company} to only:
    • the (optional) followed by
    • The copyright holder extracted from the copyright notice at the top of the file

Option to exclude files from ament_auto_lint

It would be convenient if there was a way to exclude one or more files from lint checks when invoking ament_auto_lint.
This would be useful in circumstances were a package includes third-party source files (e.g. tinydir in ros2/rcl#332).
Currently, there is no apparent way to exclude a file other than not running a particular lint check.
Linters could be called separately (ie. not with ament_auto_lint), but some would still need to be extended to support file exclusions.

Implementation considerations

Ideally, we could pass a file exclusion list to ament_auto_lint and let it pass the appropriate flags to the linters it invokes, e.g.

ament_lint_auto_find_test_dependencies(
  EXCLUDE_FILES
    include/foo/bar.h
    src/bar.c
    src/baz.c
)

Another option could be to support placing a file (e.g. ament_lint.cfg) in the root of the repo that allows configuration of the various linters supported by ament_lint.

Ament uncrustify does not break line in multi-line constructor call

It seems ament_uncrustify misses a required newline in the below code. A line break is required after filter(, but for some reason, ament_uncrustify fails to enforce it.

  // Filter for only 'use_sim_time' being added or changed.
  rclcpp::ParameterEventsFilter filter(event, {"use_sim_time"},
    {rclcpp::ParameterEventsFilter::EventType::NEW,
      rclcpp::ParameterEventsFilter::EventType::CHANGED});

https://github.com/ros2/rclcpp/blob/ee6ab95cfc8ecab353d4cf1efdb81de237424f11/rclcpp/src/rclcpp/time_source.cpp#L247-L250

Cannot satisfy both cpplint and uncrustify

I've seen one case, where I can't make both pass (maybe, it's just my error).

If you have an else if, where the condition have to be split in two lines because it's too long, e.g.:

if (...) {
  ...
} else if ( <long condition
  that uses more than one line>)
{
  ...
}

cpplint shows this failure:
If an else has a brace on one side, it should have it on both [readability/braces] [5]

For every other possibility I've tried, uncrustify don't pass.
For example:

if (...) {
  ...
} else if ( <long condition
  that uses more than one line>) {
    ...
}
if (...) {
  ...
}
else if ( <long condition
  that uses more than one line>)
{
  ...
}

The only way of working it around, is putting the if clause nested in the else. But that's only acceptable for one else if, not for multiple.
e.g.:

if (...) {
  ...
} else {
  if ( <long condition
    that uses more than one line>)
  {
    ...
  }
}

Triggered by ros2/rclcpp#778 (comment).
I've also used the last workaround somewhere else (I don't remember where).

When build with colcon --symlink-install, ament_uncrustify config winds up in build folder

Not sure if this is a bug or not, but when building colcon build --packages-select ament_uncrustify --merge-install --symlink-install, ament_uncrustify looks for the default config file at:
/opt/ros/master/build/ament_uncrustify/ament_uncrustify/configuration/ament_code_style.cfg

I would expect it to look either within the src or the install directory, not build.

check for unused includes in C++

It seems that cpplint's include_what_you_use doesn't check for unused included headers.
It would be great to either extend it or use another static analysis tool to check this

Duplicate functions across ament linters with different functionality

Many of the linters (clang-format, cppcheck, cpplint, flake8, pep257, etc.) utilize identically named functions (get_xunit_content, get_files, and find_executable) which all express a similar but slightly different functionality based on the linter being used.

Core Functionality of Identically-Named Functions

Note: Given this issue, some of the received arguments may vary between linters

  1. get_xunit_content
  • Receive a report consisting of logging data, a test name, and an elapsed time
  • Log to an .xml file
  1. get_files
  • Receive the paths to consider and the desired file extensions
  • Return the valid files
  1. find_executable
  • Receive a file name indicating the desired executable and additional specified paths (default is None)
  • Search PATH and additional paths for the executable

These functions could likely be unified and condensed.

ament_pep257 does not match pydocstyle's pep257 definition

The set of ignores that defines pep257 in pydocstyle http://www.pydocstyle.org/en/latest/error_codes.html#default-conventions

['D203', 'D212', 'D213', 'D214', 'D215', 'D404', 'D405', 'D406', 'D407', 'D408', 'D409', 'D410', 'D411', 'D413', 'D415', 'D416', 'D417']

versus the set of default ignores in ament_pep257

['D100', 'D101', 'D102', 'D103', 'D104', 'D105', 'D106', 'D107', 'D203', 'D212', 'D404']

Results in the following checks that are not part of pep257 being run

['D213', 'D214', 'D215', 'D405', 'D406', 'D407', 'D408', 'D409', 'D410', 'D411', 'D413', 'D415', 'D416', 'D417']

pydocstyle generates the list of codes to check by either using a convention or an ignore list. ament_pep257 currently uses --ignore

'--ignore=' + ','.join(ignore),

This should probably be changed to --add-ignore. Then, pydocstyle will default to using --convention=pep257, and then pep257's defaults are used in addition to any user specified ignores.

We can simplify the default ignores at that point to just ['D1']

default=[
'D100', 'D101', 'D102', 'D103', 'D104', 'D105', 'D106', 'D107',
'D203', 'D212', 'D404',
],

ament_clang_tidy doesn't show errors, thinks all headers are system headers

I'm trying to use the new ament_clang_tidy, but it's not (1) explaining the errors generated (2) emitting the 96357 warnings it thinks are in non-user code. I'm running Python 3.6.8

ament_clang_tidy src/ros2/demos

1 error generated.
Error while processing /opt/ros/master/src/ros2/demos/composition/include/composition/client_component.hpp.
2 errors generated.
Error while processing /opt/ros/master/src/ros2/demos/composition/include/composition/listener_component.hpp.
3 errors generated.
Error while processing /opt/ros/master/src/ros2/demos/composition/include/composition
...
Error while processing /opt/ros/master/src/ros2/demos/quality_of_service_demo/rclcpp/src/liveliness.cpp.
95568 warnings and 71 errors generated.
Error while processing /opt/ros/master/src/ros2/demos/quality_of_service_demo/rclcpp/src/utils.cpp.
96367 warnings and 72 errors generated.
Error while processing /opt/ros/master/src/ros2/demos/quality_of_service_demo/rclcpp/src/utils.hpp.
Suppressed 96357 warnings (96357 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.

ament_uncrustify formats messages with default values incorrenctly

Given the following message:

int16[2] value_a [1, 2]
int16[2] value_b [3, 4]

the C++ generator produces the following code:

...
  Various_()
  : value_a({{1, 2}}),
    value_b({{3, 4}})
  {
  }
...

however, uncrustify with https://github.com/ament/ament_lint/blob/master/ament_uncrustify/ament_uncrustify/configuration/ament_code_style.cfg reformats the generated code as:

6: --- /home/esteve/Projects/ros2_java/output/build_isolated_java/rosidl_generator_cpp/rosidl_generator_cpp/rosidl_generator_cpp/msg/various__struct.hpp
6: +++ /home/esteve/Projects/ros2_java/output/build_isolated_java/rosidl_generator_cpp/rosidl_generator_cpp/rosidl_generator_cpp/msg/various__struct.hpp.uncrustify
6: @@ -41,2 +41 @@
6: -    value_b({{3, 4}})
6: -  {
6: +    value_b({{3, 4}}) {
6:
6: 1 files with code style divergence

which causes ament_uncrustify to fail.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.