This is a list of all messages which might be shown by catkin_lint.
Each problem has a unique ID (such as catkin_order_violation),
which you can use to disable certain messages, either with the command line option
--ignore ID
, or by adding a pragma line #catkin_lint: ignore ID
at the beginning
of the CMakeLists.txt file. As a third option, you can add a pragma line #catkin_lint: ignore_once ID
right before the offending statement. Use this if you want to ignore a particular instance
of a problem but still be notified if the same problem occurs someplace else. You may
also use #catkin_lint: report ID
at any point to override a previous ignore
.
Since version 1.5.4, you may also customize the severity with the command line options
--error ID
, --warning ID
, or --notice ID
. You can also add the pragma line
#catkin_lint: skip
in any if()
, foreach()
, or macro()
block, which will instruct
the parser to ignore all remaining commands in the block until the else()
, endif()
,
endforeach()
, or endmacro()
statement.
- ID: no_catkin_component
- Severity: error
- Explanation: The
find_package(catkin)
call can list other catkin packages as dependencies with the COMPONENTS keyword. This is shorter than multiplefind_package()
calls, but does not work for system dependencies.
- ID: external_interface_path
- Severity: warning
- Explanation: You have exported an include path as part of your interface for dependent targets, but that path does not belong to your package. You probably meant to use the PRIVATE scope if you merely need that include path for your build. If you actually wanted to export the path to your dependees, you hould be aware that target properties will be exported as fixed strings, meaning your installed package will break if that location changes for any reason. A more robust way would be to use
target_link_libraries(scope)
with the proper imported target instead.
- ID: catkin_order_violation
- Severity: error
- Explanation: Catkin macros cannot be called before catkin has been configured with
find_package(catkin)
.
- ID: invalid_meta_command
- Severity: error
- Explanation: Meta packages do not contain code or data and are merely dependency lists with very strict requirements for the format of the CMakeLists.txt file.
- ID: missing_directory
- Severity: error
- Explanation: This catkin command processes a particular directory which is missing from the package source folder.
- ID: missing_file
- Severity: error
- Explanation: This catkin command processes a particular file which is missing from the package source folder.
- ID: cmd_case
- Severity: notice
- Explanation: The catkin manual recommends that all commands be written in lower case.
- ID: unguarded_test_cmd
- Severity: error
- Explanation: You have used a test command without properly guarding it by a
if(CATKIN_ENABLE_TESTING)
block.
- ID: external_directory
- Severity: warning
- Explanation: This catkin command uses a directory which lies outside of the package source folder. While this may work in your particular setup, you cannot assume file locations in general. Use
find_path()
to detect external locations insteed.
- ID: external_file
- Severity: error, warning
- Explanation: This catkin command uses a file which lies outside of the package source folder. While this may work in your particular setup, you cannot assume file locations in general. Use
find_file()
to detect external locations insteed.
- ID: uninstalled_plugin
- Severity: error, warning
- Explanation: Your package can be used from the devel space but cannot be installed properly, because a plugin declaration file which is listed in your package.xml is not installed to the correct location.
- ID: plugin_export_prefix
- Severity: error
- Explanation: The ${prefix} variable is carefully overloaded to work with both devel space and install space and must be used in all tags.
- ID: missing_plugin
- Severity: error
- Explanation: A plugin declaration file which is listed in your package.xml is missing from the package source folder.
- ID: cmake_old
- Severity: warning
- Explanation: You are using a CMake feature which is supported only by CMake version or newer. You should set your
cmake_minimum_required()
declaration accordingly.
- ID: order_violation
- Severity: error
- Explanation: Certain configuration macros must be called in a specific order as specified by the catkin build manual. Failure to do so may lead to improper configuration of the package and build problems.
- ID: deprecated_cmd
- Severity: error
- Explanation: Some macros have been deprecated and replaced by newer versions. Please upgrade your CMakeLists.txt to ensure compatibility with future caktin versions.
- ID: wrong_depend
- Severity: error
- Explanation: You have listed a package as the wrong dependency type. The catkin build system defines a number of different dependencies for building a package, running its nodes or linking against its libraries. As a general rule, buildtool_depends are needed to build the package, build_depends are non-transitive build dependencies which are not visible to users of your package, build_export_depends are publicly visible transitive dependencies, exec_depends are needed at runtime, and test_depends are for unit tests only.
- ID: deprecated_cmake_module
- Severity: warning
- Explanation: Some CMake modules have been provided by cmake_modules in the past, but are now provided by the system package or CMake itself. Please upgrade your CMakeLists.txt to ensure compatibility with future catkin versions.
- ID: os_error
- Severity: error
- Explanation: An operating system error has occured. This is not a linting problem per se but might be caused by a missing or unreadable file.
- ID: shadowed_find
- Severity: error
- Explanation: You have more than one
find_package()
call for a package, and the COMPONENTS list of the later call does not include a previously chosen component.
- ID: wrong_catkin_metapackage
- Severity: error
- Explanation: The
catkin_metapackage()
command signals your intent to declare a meta package, but the package.xml does not contain a tag.
- ID: catkin_as_system_depend
- Severity: error
- Explanation: In your
catkin_package()
call, you have listed a catkin package in the DEPENDS stanza, but it belongs in the CATKIN_DEPENDS stanza instead.
- ID: system_as_catkin_depend
- Severity: error
- Explanation: In your
catkin_package()
call, you have listed a system dependency in the CATKIN_DEPENDS stanza, but it belongs in the DEPENDS stanza instead.
- ID: unconfigured_system_depend
- Severity: error
- Explanation: In order to export a system package as dependency, you must either call
find_package(pkg)
first or initialize the pkg_INCLUDE_DIRS and pkg_LIBRARIES variables manually.
- ID: build_include_path
- Severity: error
- Explanation: You listed a build path below ${CMAKE_BINARY_DIR} in the INCLUDE_DIRS stanza of your
catkin_package()
call. These paths are only available for develspace builds and will be missing for installed packages.
- ID: external_include_path
- Severity: error
- Explanation: You listed one or more include paths in the INCLUDE_DIRS stanza of your
catkin_package()
call which are not part of your package. If you want to export include paths of other modules, usefind_package()
,find_path()
, and/orfind_library()
and add the dependency to the DEPENDS stanza.
- ID: uninstalled_include_path
- Severity: error, warning
- Explanation: Your package can be used from the devel space but cannot be installed properly, because the header files will not be copied to the proper location.
- ID: exported_pkg_config
- Severity: error
- Explanation: Although CMake can invoke pkg-config to detect other modules, this does not work well with catkin, as pkg-config may require you to add link directories. Use the results of
pkg_check_module()
as hint forfind_path()
andfind_library()
instead.
- ID: wrong_catkin_package
- Severity: error
- Explanation: Meta packages use the
catkin_metapackage()
command to declare a meta package. This performs additional checks and ensures that all requirements are met.
- ID: ambiguous_condition
- Severity: warning
- Explanation: Historically, the
if()
command will interpret a single token as a variable name and transparently resolve it if possible. Unquoted variable references likeif(${var})
can lead to incorrect results if ${var} resolves to a different variable name. Useif(var)
orif("${var}")
instead.
- ID: duplicate_cmd
- Severity: error
- Explanation: You have called this command more than once, but this does not make sense. If the calls use different arguments, consolidate them into a single call, otherwise simply remove the second.
- ID: duplicate_find
- Severity: warning
- Explanation: You called
find_package()
more than once for a particular package, which is not needed except for very specific, advanced circumstances.
- ID: duplicate_include_path
- Severity: warning
- Explanation: Include paths of packages listed in the
find_package(catkin)
command are added implicitly by the ${catkin_INCLUDE_DIRS} variable. There is no need to add it a second time.
- ID: env_var
- Severity: warning
- Explanation: The behavior of your build should not depend on any environment variables.
- ID: wrong_bin_install_destination
- Severity: warning
- Explanation: Your package installs one or more files to an unexpected location. Executable files should end up in either ${CATKIN_GLOBAL_BIN_DESTINATION} or ${CATKIN_PACKAGE_BIN_DESTINATION}.
- ID: missing_include_path
- Severity: error
- Explanation: You have listed an invalid include path in the INCLUDE_DIRS stanza of the
catkin_package()
command.
- ID: export_lib_renamed
- Severity: error
- Explanation: Due to a limitation of the catkin build system, the
catkin_package()
library export function will break if the logical target name is not equal to the actual library name.
- ID: export_lib_not_lib
- Severity: error
- Explanation: You listed a library in the LIBRARIES stanza of your
catkin_package()
call, but it really is an executable.
- ID: uninstalled_export_lib
- Severity: error, warning
- Explanation: Your package can be used from the devel space but cannot be installed properly, because a library that is exported via
catkin_package()
will not be copied to the proper location.
- ID: missing_export_lib
- Severity: warning
- Explanation: Your package exports a package include path and builds at least one library, which suggests that you may want to export the library to other packages as well.
- ID: endblock_args
- Severity: notice
- Explanation: The catkin manual recommends that cmd and other end-of-block statements have no arguments. If you have nested blocks, you should indent them properly instead.
- ID: uninstalled_script
- Severity: warning
- Explanation: Your package contains a file that is marked as executable but not installed. If it is a script intended to be run (e.g. with rosrun), it will not work outside the devel tree. If it is not an executable script, you should fix the file permissions.
- ID: missing_python_setup
- Severity: error
- Explanation: The
catkin_python_setup()
call is required to properly configure python modules, and the existing setup.py indicates that your package provides one or more python modules.
- ID: missing_cmake_modules
- Severity: warning
- Explanation: You need to
find_package()
cmake_modules before you can use one of its custom configuration modules.
- ID: missing_required
- Severity: error, warning
- Explanation: The package cannot build without this dependency, so it should be marked as REQUIRED accordingly. Use
if(pkg_FOUND)
clauses to use optional packages.
- ID: unused_generate_msg
- Severity: warning
- Explanation: The
generate_messages()
call creates the messages, services, and actions which are declared in your package. If your package does not supply any of these, you do not have to callgenerate_messages()
at all.
- ID: global_var_collision
- Severity: notice
- Explanation: Global variables and options are stored in the cache. You should prefix your variable names with the project name to avoid name collisions with other packages.
- ID: header_outside_package_include_path
- Severity: notice
- Explanation: It is recommend that all header files are installed into a package-specific include subdirectory to prevent file name collisions between different packages. The variable ${CATKIN_PACKAGE_INCLUDE_DESTINATION} will point to the correct location.
- ID: unused_include_path
- Severity: warning
- Explanation: You have listed an include path in the INCLUDE_DIRS stanza of the
catkin_package()
command, but that path is not mentioned in anyinclude_directories()
call.
- ID: ambiguous_include_path
- Severity: warning
- Explanation: You have used two include paths where one is a parent of the other. Thus the same headers can be included with two different include paths which may confuse users. It is recommended that you keep your include paths consistent.
- ID: wrong_install_destination
- Severity: warning
- Explanation: Your package installs one or more files to an unexpected location. Catkin provides a number of standard variables ${CATKIN_*_DESTINATION} to specify installation folders. You should use those to ensure that your package will continue to work if the file system layout is changed in the future.
- ID: launch_depend
- Severity: warning
- Explanation: Your package refers to another package in one of its launch files, but you do not have this dependency in your package.xml
- ID: redundant_lib_prefix
- Severity: notice
- Explanation: Libraries are automatically prefixed with 'lib', so your library will end up with a file name like 'liboutput.so'. You can use
set_target_properties(... PROPERTIES OUTPUT_NAME ...)
to give your library a different file name without changing the target name.
- ID: indentation
- Severity: notice
- Explanation: For better readability, each command should be placed on its own line.
if()
andforeach()
bodies should be indented by one or more extra spaces.
- ID: external_link_directory
- Severity: error
- Explanation: Directories which are added to the search path with
link_directories()
will not be propagated to dependent packages. Usefind_package()
orfind_library()
with the appropriate PATHS or HINTS instead.
- ID: unsorted_list
- Severity: notice
- Explanation: The catkin manual recommends that list element be kept in order.
- ID: argument_error
- Severity: warning
- Explanation: You invoked a CMake command with a malformed argument list. Most likely, you forgot to properly quote variables which may be empty or undefined.
- ID: description_meaningless
- Severity: notice
- Explanation: Your package description merely consists of typical filler words which do not actually describe the contents of your package in a meaningful way.
- ID: invalid_meta_depend
- Severity: error
- Explanation: Meta packages do not contain code or data and are merely dependency lists. As meta packages do neither build nor test anything, the only valid dependency type is the run_depend.
- ID: misconfigured_catkin_package
- Severity: error
- Explanation: You use an unsupported way to include a catkin package in your build. Even though this might work in your particular case, you should use the proper
find_package()
mechanism to make sure that all relevant CMake macros will be run.
- ID: missing_cmd
- Severity: error
- Explanation: You failed to call a command that is required for your package to work. Please refer to the catkin build manual for details.
- ID: missing_depend
- Severity: error
- Explanation: Your package uses features of another package but you failed to list this dependency in your package.xml
- ID: missing_components
- Severity: notice
- Explanation: The
find_package(catkin)
call can add other catkin packages as dependencies with the COMPONENTS keyword. Thefind_package()
command lists additional packages but has no COMPONENTS keyword.
- ID: missing_find
- Severity: error
- Explanation: You failed to call
find_package()
for a dependency of your package.
- ID: missing_generate_msg
- Severity: error
- Explanation: The
generate_messages()
call creates the messages, services, and actions which are declared in your package byadd_message_files()
,add_service_files()
, andadd_action_files()
respectively.
- ID: unused_catkin_include_dirs
- Severity: error
- Explanation: You must add the catkin include paths to your include search list, or you might experience build failures.
- ID: unquoted_string_op
- Severity: notice
- Explanation: The catkin manual recommends that
if()
conditions with string operators should have the operands enclosed in double quotes.
- ID: missing_catkin_depend
- Severity: error
- Explanation: You have a runtime dependency that you must add to the CATKIN_DEPENDS stanza of your
catkin_package()
.
- ID: description_boilerplate
- Severity: notice
- Explanation: Your package description starts with a number of typical filler words which do not actually describe the contents of your package. Typically, you can simply delete these words from the description, and it will still make sense and be much more concise.
- ID: plugin_depend
- Severity: warning
- Explanation: Your package exports a plugin for another package, but fails to list said package as a dependency.
- ID: package_path_name
- Severity: notice
- Explanation: Your package resides in a folder that has a different name than the package itself. This is confusing and might break the assumptions of some tools.
- ID: parse_error
- Severity: warning
- Explanation: Your package has a malformed file that could not be processed for linting.
- ID: project_name
- Severity: error
- Explanation: The CMake project name must be identical to the package name. For backwards compatibility reasons, both names should also be identical to the name of the source folder that contains the package.
- ID: undefined_target
- Severity: error
- Explanation: Your package installs or exports a CMake target which is not defined at all. This could be a typo, or the target is implicitly defined by a macro that is unknown to catkin_lint.
- ID: missing_shebang
- Severity: error
- Explanation: All interpreter scripts need an appropriate shebang line, i.e. the first line has to start with '#!' and needs to name the full path to the interpreter executable.
- ID: script_not_executable
- Severity: error
- Explanation: Your package contains a script file that has to be marked as executable. On Un*x systems, run 'chmod +x "script"' to set the executable bit.
- ID: subproject
- Severity: warning
- Explanation: Your package has an independent subproject. This can interact with catkin in unusual ways and is strongly discouraged. No further checks are performed in this subdirectory.
- ID: duplicate_subdir
- Severity: error
- Explanation: You added another subdirectory with
add_subdirectory()
multiple times. This can also happen if you accidentally created a loop where subdir A adds subdir B, which adds subdir A again.
- ID: missing_subdir
- Severity: error
- Explanation: You specified a subdirectory which does not exists or is unreadable.
- ID: external_subdir
- Severity: error
- Explanation: You added another subdirectory with
add_subdirectory()
, but the specified path points outside of the package source directory.
- ID: cmake_ancient
- Severity: warning
- Explanation: Starting with CMake 3.19, compatibility with ancient CMake versions has been deprecated and triggers a developer warning. Most likely, you are not actually depending on ancient CMake behavior and can bump the minimum required version without ill effects.
- ID: uninstalled_depend
- Severity: error
- Explanation: Your package can be used from the devel space but cannot be installed properly, because one of your installed targets depends on a library from your package that is not installed as well.
- ID: invalid_target_output
- Severity: error
- Explanation: The output file that your target is supposed to generate contains invalid characters in its name. You probably forget to call
set_target_properties(... PROPERTIES OUTPUT_NAME ...)
- ID: uninstalled_target
- Severity: warning
- Explanation: Your package can be used from the devel space but cannot be installed properly, because the build target will not be copied to the proper location.
- ID: unguarded_test_depend
- Severity: error
- Explanation: You have used a test dependency without properly guarding it by a
if(CATKIN_ENABLE_TESTING)
block. You must add a proper build dependency if you wish to use this package even if tests are disabled.
- ID: unconfigured_build_depend
- Severity: error
- Explanation: You declare a build dependency on another package but neither call
find_package()
nor have it listed as catkin component in thefind_package(catkin)
call.
- ID: unconfigured_msg_depend
- Severity: error
- Explanation: Your messages depend on another package which is neither
find_package()
'd nor listed as a component in thefind_package(catkin)
call.
- ID: unknown_package
- Severity: error
- Explanation: You are referring to a package which seems to be neither a catkin package nor a known system dependency. You may have misspelled the name, or your rosdep database needs to be refreshed with "rosdep update".
- ID: unused_depend
- Severity: error
- Explanation: You have a listed a package dependency but do not appear to use any of the features it provides.
- ID: literal_project_name
- Severity: notice
- Explanation: The catkin manual recommends that you use the ${PROJECT_NAME} variable instead of the literal project name.
- ID: find_by_include
- Severity: error
- Explanation: The FindXXX.cmake modules are intended to be included by the
find_package()
command.
- ID: link_directory
- Severity: warning
- Explanation: Directories which are added to the search path with
link_directories()
will not be propagated to dependent packages. You should avoid this command or at least be aware that it might not work as expected in dependent packages.
- ID: critical_var_append
- Severity: warning
- Explanation: You have appended extra data to a critical CMake variable. This might break the build on different systems or affect the global catkin workspace in unintended ways.
- ID: immutable_var
- Severity: error
- Explanation: You have modified a CMake variable that is initialized by CMake itself and must not be modified under any circumstances.
- ID: critical_var_overwrite
- Severity: error
- Explanation: You have overwritten a critical CMake variable and its original content is lost. This will most likely break the build on different systems or affect the global catkin workspace in unintended ways.
- ID: cmake_build_type
- Severity: error
- Explanation: If you wish to provide a default value for CMAKE_BUILD_TYPE, make sure that you do not overwrite user preferences. You should guard the
set()
command with an appropriateif(NOT CMAKE_BUILD_TYPE)
block.