CATKIN_LINT(1)
π CATKIN_LINT(1) β the catkin_lint manual, bestie edition π
okay so picture this: it's a Robot OS situation, and you've got a catkin_lint command. That's the whole vibe. It's a manual page, it's long, and we're doing it in two parts, so buckle up π
β¨ NAME β¨
catkin_lint β check catkin packages for common errors
πΈ SYNOPSIS πΈ
catkin_lint [--config FILE] [--quiet | --no-quiet]
[--severity-level LEVEL]
[--notice ID] [--warning ID] [--error ID]
[--ignore ID] [--show-ignored]
[--strict | --no-strict]
[--pkg PKG] [--skip-pkg PKG]
[--package-path PATH] [--skip-path MATCH]
[--rosdistro DISTRO] [--offline] [--no-offline]
[--rosdep-cache-path PATH]
[--resolve-env | --no-resolve-env]
[--output FORMAT | --text | --explain | --xml | --json]
[--color MODE]
[PATH [PATH ...]]
π DESCRIPTION π
So catkin_lint is out here checking package configurations for the catkin build system of ROS. It does a static analysis of the "package.xml" and "CMakeLists.txt" files in your package, and it will detect and report a bunch of common problems. no cap, it's just reading your files and judging (lovingly) π«Ά
All diagnosed problems come in one of three possible severities:
- Errors are severe enough to break the build and/or produce unintended side effects. Usually, they violate the rules outlined in the catkin manual. π these are the ones you actually have to fix.
- Warnings are potential errors which may indicate a bug in your package but may be justified for reasons catkin_lint cannot discern. Constructs which trigger a warning can usually be modified in a way that is functionally equivalent but more robust. like, it's giving "suspicious but maybe fine" energy.
- Notices are issues which are not objectionable from a technical view point but should be addressed to improve the quality of the package. Many notices highlight violations of the recommendations and best practises from the catkin manual. π the glow-up suggestions.
π OPTIONS π
--config FILEβ Read configuration settings from FILE. This option can be used multiple times. See"CONFIGURATION FILE FORMAT"for details. stack them configs, bestie β¨--quiet,-qβ Suppress all outputs expect for the detected problems, in particular, do not show the summary at the end. just the tea, none of the small talk.--no-quietβ Show a summary of the findings at the end. This is the default setting. (yes bestie, the default, so if you never touched anything, this is what you're getting)--severity-level LEVEL,-W LEVELβ Choose the severity level for diagnostic output. Level0displays errors only, level1displays errors and warnings, and level2displays everything. The default setting is-W1. ποΈ pick your chaos level.--notice ID,--warning ID,--error IDβ Override the default severity of certain problems. See"PROBLEM IDS"for details on the available IDs. you get to promote or demote problems, main character energy fr.--ignore IDβ Ignore a problem. This is mostly useful to work around a known bug incatkin_lint, because problems tend to not go away if you ignore them. See"PROBLEM IDS"for details on the available IDs. π (and yes, that caveat is real β ignoring is NOT fixing, it's just looking away)--show-ignoredβ Show all problems you ignored. Use this if an ignored problem did not go away, but you forgot which one. we love a receipts moment π--strictβ Treat any reported problem as a fatal error. Some people use the option to enforce that warnings get fixed, too. You can also combine this with-W2to turn even notices into errors, if you are exceptionally pedantic and/or have a high pain tolerance. ππ₯ you've been warned, that's a lot of pain tolerance.--no-strictβ This will undo the effects of your rash decision to put"strict=yes"in your configuration file. This is also the default setting. we've all been there, no judgement π«Ά--pkg PKGβ Check the package PKG for problems. The package must be in the ROS package search path.--skip-pkg PKGβ Skip the package PKG when processing a package subtree. The package will not be linted, but it will be treated as a known package for dependency resolutions. so it still counts as existing, it just doesn't get the vibe check π--package-path PATH[:PATH[...]]β Add one or more additional locations to the ROS package search path. Separate multiple locations with":".catkin_lintwill use this path list and theROS_PACKAGE_PATHenvironment variable to resolve the--pkgoption and dependencies of linted packages.--skip-path MATCHβ Skip packages if their location contains MATCH. No wildcards or pattern matching allowed, only proper substrings are recognized. substring only, bestie, don't get fancy β¨--rosdistro DISTROβ Assume that all packages are supposed to work with the ROS distribution DISTRO. By default, this value is taken from theROS_DISTROenvironment variable.catkin_lintwill use this to query the ROS database for packages which are not locally installed.--offlineβ Forbid metadata queries to the ROS package index. This will disable certain diagnostics which rely on knowing details about all package dependencies. Metadata queries are not needed for packages which can be found locally through the ROS package search path. airplane mode but for package metadata π¦--no-offlineβ Allow metadata queries to the ROS package index. This is the default.--rosdep-cache-path PATHβ Override the default location of the rosdep sources cache. This option has the same effect as setting theROSDEP_CACHE_PATHenvironment variable.--resolve-envβ Resolve environment variables$ENV{}in CMake scripts. By default,catkin_lintwill treat all environment variables like empty strings and issue a warning.--no-resolve-envβ Do not resolve environment variables$ENV{}in CMake scripts and issue a warning if they are used. This is the default.--output FORMATβ Select the output format for the diagnosed problems. Valid output formats aretext,explain,json, andxml. See"OUTPUT FORMATS"for more details.--text,--explain,--json,--xmlβ These are deprecated aliases for--output FORMAT. π deprecated, so like, they work, but we're side-eyeing them.--color MODEβ Configure the colorization of thetextandexplainoutput formats. The default mode isauto, which will use ANSI colors ifcatkin_lintdetects a terminal as output. The modesalwaysandneverwill override the detection and output ANSI colors always or never, respectively. π pretty terminal colors, iconic.
π OUTPUT FORMATS π
catkin_lint supports a variety of output formats as argument for the --output option:
textβ This is the default format, which outputs a short, human-readable description of all problems.explainβ This is an extended text format, which will show an additional explanation when a problem type occurs for the first time. It will also mention the message ID which you need to change the severity or ignore a problem. π this is the one that actually teaches you stuff, obsessed.jsonβ Outputs all problems in JSON format.xmlβ Outputs all problems in XML format.
π ENVIRONMENT π
catkin_lint uses ROS_PACKAGE_PATH to find locally available packages and ROS_DISTRO to determine the installed ROS distribution when querying the ROS package index or the rosdep database. All other environment variables will be ignored, unless catkin_lint is instructed to resolve them in CMake scripts by --resolve-env.
β RETURN VALUES β
0β All packages were linted successfully and no errors occurred. π slay.1β An error occurred.66β No packages found.
(part 1 done bestie, more coming β don't go anywhere) π
β¨ CONFIGURATION FILE FORMAT β¨
Okay so bestie, catkin_lint is obsessed with config files. It looks for configuration options in these exact places, in this order (no cap):
- Files explicitly specified using
--config .catkin_lintfiles in all locations fromROS_PACKAGE_PATH$XDG_CONFIG_HOME/catkin_lint~/.config/catkin_lintifXDG_CONFIG_HOMEis unset or empty~/.catkin_lint
Then it reads all available config files and merges them into one single configuration. Earlier entries in the list above will take precedence if conflicting options are found. Command line arguments will override any configuration file setting. Config files are in an INI-style format with one or more sections in it. Slay.
πΈ [catkin_lint] section πΈ
The main section is called [catkin_lint] and it takes these catkin_lint-specific options:
color = auto | never | alwaysβ Determine output colorization mode. The default settingautowill enable colorization if and only if standard output is connected to terminal. The modesalwaysandneverwill override the detection and output ANSI colors always or never, respectively. πoffline = no | yesβ Allow or forbid metadata queries to the ROS package index. This will disable certain diagnostics which rely on knowing details about all package dependencies. Metadata queries are not needed for packages which can be found locally through the ROS package search path. The default setting isno.output = text | explain | json | xmlβ Select the output format for problem reports. See "OUTPUT FORMATS" for details. The default setting istext.package_path = PATH[:PATH[...]]β Prepend the specified PATHs toROS_PACKAGE_PATHin order to find locally available packages and/or package dependencies.quiet = no | yesβ Select output verbosity. The default settingnoallows catkin_lint to print some additional information to standard error, such as a final summary of all detected problems.resolve_env = no | yesβ Allow or forbid resolution of environment variables. The default settingnolets catkin_lint ignore environment variables and issue a warning whenever a CMake command references the environment using$ENV{}.rosdistro = DISTROβ Assume that all packages are supposed to work with the ROS distribution DISTRO. By default, this value is taken from theROS_DISTROenvironment variable. catkin_lint will use this to query the ROS database for packages which are not locally installed.rosdep_cache_path = PATHβ Override the default location of the rosdep sources cache. This option has the same effect as setting theROSDEP_CACHE_PATHenvironment variable.severity_level = 0 | 1 | 2β Choose the severity level for diagnostic output. Level 0 displays errors only, level 1 displays errors and warnings, and level 2 displays everything. The default setting is 1.strict = no | yesβ In strict mode, catkin_lint will treat every reported problem as error and return with exit code 1 (see "RETURN VALUES"). By default, warnings and notices are informational only. This setting is mostly interesting for automated test runs, where the exit code is evaluated. Note that ignored problems and everything hidden by the chosen severity_level will not be considered failures.
π Package-specific severity overrides π
All section names besides [catkin_lint] are interpreted as package names and will override the reported severities of problems. As a special case, the section [*] will apply to all packages. The overrides are specified in the format ID = Severity, where the severity can be one of ignore, error, warning, notice, or default. See "PROBLEM IDS" for details on the available IDs.
Unlike --strict, this gives you very fine-grained control over which problems are supposed to be fatal, so you are encouraged to integrate catkin_lint into your CI test pipeline and tune the settings in a way that fits your project. So extra, I love it.
π₯ PROBLEM IDS π₯
You can run catkin_lint --help-problem to get a list of all problem IDs, and catkin_lint --help-problem ID for a more detailed explanation of each problem. iykyk
π EXAMPLES π
β¨ Command line arguments β¨
catkin_lint ~/catkin_ws/src
Check all packages in ~/catkin_ws/src for problems.
catkin_lint --pkg foo --pkg bar
Check the packages foo and bar for problems, assuming that they can be found in one of the locations listed in ROS_PACKAGE_PATH.
catkin_lint --pkg foo --pkg bar --package-path ~/my_other_ws/src
Check the packages foo and bar for problems when the former assumption turned out to be false.
catkin_lint ~/catkin_ws/src --skip-path unstable
Check all packages in ~/catkin_ws/src, but skip all packages in a path that contains the string unstable.
catkin_lint ~/catkin_ws/src --skip-pkg baz
Check all packages except baz in ~/catkin_ws/src.
π Configuration file π
The following configuration file will instruct catkin_lint to output its results in JSON format, ignore any problems with unknown packages (except in the package foo), and elevate the notice about unsorted lists to a warning for all packages (including foo):
[catkin_lint]
output = json
quiet = yes
[*]
unknown_package = ignore
unsorted_list = warning
[foo]
unknown_package = default
π REFERENCES π
https://fkie.github.io/catkin_lint/
π That's the whole vibe, bestie! This manual page is from catkin_lint version1.6.25, dated2024-09-24. Now go lint your heart out! π
π¦ where this page comes from
- debian trixie: catkin-lint 1.6.25-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms