roscompile is a tool for improving Catkin packages by fixing common errors and tweaking the style.
To run, simply navigate to a folder containing the packages you'd like to tweak, and type roscompile
.
This will automatically apply all the fixes described below.
Certain rules can be ignored by tweaking the configuration.
If you want to interactively apply the rules, use the -i
option.
You can also explicitly enumerate which fixes you want to run with the roscompile_command
executable.
There are also some other useful scripts described at the bottom of this documentation.
- Checks for dependencies by looking in the source code, message, service, action and launch files.
check_manifest_dependencies
- Inserts build/run/test dependencies into yourpackage.xml
check_python_dependencies
- Inserts run dependencies for external Python librariescheck_cmake_dependencies
- Inserts dependencies into yourCMakeLists.txt
(in both thefind_package
andcatkin_package
commands)
remove_empty_export_tag
- Remove the empty export tagremove_boilerplate_manifest_comments
- Remove boiler-plate commentsremove_empty_manifest_lines
- Remove empty linesgreedy_depend_tag
If a format 2package.xml
, collapses matchingbuild_depend/build_export_depend/exec_depend
commands into a singledepend
commandenforce_manifest_tabbing
Ensure standard indentation of each tagenforce_manifest_ordering
- Sort all fo the tags by type and valueupdate_people
- Reads the <author> and <maintainer> tags and allows you to programmatically replace them. (i.e. 'dlu', 'Dave Lu', 'David Lu'', 'dlu@TODO' can all become 'David V. Lu!!') (see configuration section below)update_license
- Updates TODO licenses to a configurable default license (see configuration section below)update_metapackage
- Update your metapackage dependenciesmisc_xml_formatting
- Remove extra whitespace from inside tags in package.xml (and plugin xmls)
check_generators
- Automatically looks formsg
/srv
/action
/dynamic_reconfigure
definitions and ensures they are properly built in theCMakeLists.txt
enforce_cmake_ordering
- Enforces the ordering of the commands
-
remove_boilerplate_cmake_comments
- Removes boiler-plate comments -
remove_empty_cmake_lines
- Removes empty lines -
alphabetize_sections
- Alphabetizes theCOMPONENTS
,DEPENDENCIES
,FILES
andCATKIN_DEPENDS
sections of CMake commands -
prettify_catkin_package_cmd
- Ensures standard indentation ofcatkin_package
-
prettify_package_lists
- Ensures standard indentation offind_package/COMPONENTS
andcatkin_package/CATKIN_DEPENDS
-
prettify_msgs_srvs
- Ensures standard indentation ofadd_message_files
andadd_service_files
-
prettify_installs
- Ensures standard indentation ofinstall
commands
update_cplusplus_installs
- Checks for install commands for C++ executables/libraries/header filesupdate_python_installs
- Checks for install commands for Python executablesupdate_misc_installs
- Checks for install commands for launch files, plugin configurations and other non-code files.fix_double_directory_installs
- Checks to make sure directory installs don't use the name of the directory twice, a la$INSTALL_LOCATION/launch/launch/whatever.launch
- Examines the
add_library
andadd_executable
commands in theCMakeLists.txt
and ensures that each is matched with the appropriate catkin variables.target_catkin_libraries
- Checks dependencies on${catkin_LIBRARIES}
check_exported_dependencies
- Checks dependencies on${catkin_EXPORTED_TARGETS}
and${PKG_NAME_EXPORTED_TARGETS}
remove_old_style_cpp_dependencies
- Removes dependencies on the old style of C++ dependencies (i.e.__generate_messages_cpp
,_gencpp
and_gencfg
) and replaces them with the aboveEXPORTED_TARGETS
check_includes
- Sets up theinclude_directories
commandcheck_library_setup
- ensures your libraries are exported into thecatkin_package
command
check_setup_py
- If you have python code, will automatically generate setup.py for you.
check_dynamic_reconfigure
- If there aredynamic_reconfigure
configurations, ensure the package depends ondynamic_reconfigure
, and the configurations are configured in theCMake
and executable.remove_useless_files
- Removes autogeneratedmainpage.dox
filecheck_plugins
- If you use pluginlib, will search your code forPLUGINLIB_EXPORT_CLASS
macros, and update your plugin xml accordingly.
Located at ~/.ros/roscompile.yaml
skip_fixes
: An array of strings representing fixes that you'd like to always ignore when runningroscompile
default_license
- String for the license you want your package manifest to have (if it is set to TODO originally).replace_rules
: An array of dictionaries representing users you'd like to have replaced in thepackage.xml
. For example, one entry in the array could be:
from: {email: dlu@todo.todo, name: dlu}
to: {email: davidvlu@gmail.com, name: David V. Lu!!}
The to
name and email must be specified, but you only need to specify either the name or email for the from
.
convert_to_format_2
Convert themanifest.xml
from format 1 to format 2.add_tests
Add roslaunch and/or roslint tests to your package, updating both themanifest.xml
andCMakeLists.txt
.add_compile_options
Script to add C++ compile flags to yourCMakeLists.txt