# How do you validate your package.xmls in ROS2?

**URL:** <https://discourse.openrobotics.org/t/how-do-you-validate-your-package-xmls-in-ros2/23875>\
**Category:** ROS General\
**Tags:** ros2\
**Created:** [January 19, 2022, 12:56am UTC](https://discourse.openrobotics.org/t/how-do-you-validate-your-package-xmls-in-ros2/23875 "2022-01-19T00:56:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![wmmc88](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/wmmc88/32/12015_2.png) [@wmmc88](https://discourse.openrobotics.org/u/wmmc88)\
**Post date:** [January 19, 2022, 12:56am UTC](https://discourse.openrobotics.org/t/how-do-you-validate-your-package-xmls-in-ros2/23875/1 "2022-01-19T00:56:51Z")

</div>

In ROS1, [catkin\_lint](https://fkie.github.io/catkin_lint/) is a tool that helps parse through your cmakelists and package.xml for common errors. I particularily found it very useful to find missing or mis-classified dependencies in my package.xml files. Does anyone know of any tool that provides similar functionality for ros2?

---

<div class="post-metadata">

**Author:** ![bmagyar](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/bmagyar/32/15336_2.png) [@bmagyar](https://discourse.openrobotics.org/u/bmagyar)\
**Post date:** [January 19, 2022, 6:49am UTC](https://discourse.openrobotics.org/t/how-do-you-validate-your-package-xmls-in-ros2/23875/2 "2022-01-19T06:49:59Z")

</div>

Roughly a year ago I asked the same thing from the maintainers of ament lint but it wasn’t part of the plan at that time. I think it’d be very useful and pretty much the full functionality could be achieved with an ament version.

---

<div class="post-metadata">

**Author:** ![Jitka\_Hodna](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/jitka_hodna/32/8538_2.png) [@Jitka\_Hodna](https://discourse.openrobotics.org/u/Jitka_Hodna)\
**Post date:** [January 19, 2022, 9:59pm UTC](https://discourse.openrobotics.org/t/how-do-you-validate-your-package-xmls-in-ros2/23875/3 "2022-01-19T21:59:48Z")

</div>

It would be great to have one 🙂

---

<div class="post-metadata">

**Author:** ![tfoote](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/tfoote/32/3813_2.png) [@tfoote](https://discourse.openrobotics.org/u/tfoote)\
**Post date:** [January 20, 2022, 12:16am UTC](https://discourse.openrobotics.org/t/how-do-you-validate-your-package-xmls-in-ros2/23875/4 "2022-01-20T00:16:55Z")

</div>

There’s a package [ament\_xmllint](https://github.com/ament/ament_lint/tree/master/ament_xmllint) which was created for that purpose. It looks like the basic functionality is there and it will need to use the package.xml schema to validate the xml appropriately.

> <https://github.com/ament/ament_lint/blob/e4e45fca36974e5681b6cac1e2ac835b4c3692eb/ament_xmllint/package.xml#L7>

If someone would like to extend this I’m sure that would be appreciated by the maintainers.

---

<div class="post-metadata">

**Author:** ![wmmc88](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/wmmc88/32/12015_2.png) [@wmmc88](https://discourse.openrobotics.org/u/wmmc88)\
**Post date:** [January 20, 2022, 12:50am UTC](https://discourse.openrobotics.org/t/how-do-you-validate-your-package-xmls-in-ros2/23875/5 "2022-01-20T00:50:20Z")

</div>

I do use xmllint, but that’s just validating the xml file follows the schema. Catkin lint was able to do things like check for missing depends in the package xml, which requires a lot more information than just the schema.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/ros/original/3X/b/6/b607ee3cc8e908b1b613bd74a683d749fea635a1.svg) [@system](https://discourse.openrobotics.org/u/system)\
**Post date:** [February 19, 2022, 12:50am UTC](https://discourse.openrobotics.org/t/how-do-you-validate-your-package-xmls-in-ros2/23875/6 "2022-02-19T00:50:44Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
