sscpac/statick

ROS discovery setting wrong type of file type

Closed this issue · 1 comments

Running statick against a ROS1 package can result in setting a package["catkin"] or package["ros"] to a boolean value instead of a string representing a file path. When compiling there also seem to be missing dependencies on catkin-pkg and rospkg. These issues result in Statick crashing or in not analyzing ROS1 packages correctly.

The root cause of this issue is that the ROS discovery plugin would go through a package and set a field to show that it was a catkin package, specifically package["catkin"] = True. Other discovery plugins set package["file_type"] to a list of files that were discovered that the plugin should match. The catkin_lint tool plugin declares that its file types are "catkin". The Tool plugin, in scan(), searches through available file types (such as "catkin") and adds the files from package[file_type] to a list of files that should be processed by the tool.

When the ROS discovery plugin uses a boolean value to indicate a package is catkin-based, and we later try to add a boolean to a list of strings, Statick would crash. It can still be valuable to have a flag in package indicating that a package is based on ROS1 or ROS2, but we should not overload the "catkin" string to do so.