From 2d4e05c9693bee302057edce34a7b854e73c03ea Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Tue, 9 Apr 2024 15:10:20 -0400 Subject: [PATCH] Relax the XSD for package format 1, 2, and 3. Each of them has the same note in their corresponding REPs (https://www.ros.org/reps/rep-0127.html#name, https://www.ros.org/reps/rep-0140.html#name, https://www.ros.org/reps/rep-0149.html#name): " The package name must start with a letter and contain only lowercase alphabetic, numeric or underscore characters. The package name should be unique within the ROS community. It may differ from the folder name into which it is checked out, but that is not recommended. The following recommended exemptions apply, which are optional for implementations: - Dashes may be permitted in package names. This is to support maintaining a consistent dependency name when transitioning back and forth between a system dependency and in-workspace package, since many rosdep keys contain dashes (inherited from the Debian/Ubuntu name). - In support of some legacy packages, capital letters may also be accepted in the package name, with a validation warning. " The XSD should reflect this entire section, including the optional bits about allowing dashes and allowing capital letters. If we want to disallow them in some circumstances, then the downstream linters should enforce that. Because of that, this PR relaxes the XSD for each of the package formats to accept the full range. Signed-off-by: Chris Lalancette --- xsd/package_format1.xsd | 17 +++++++++++++---- xsd/package_format2.xsd | 17 +++++++++++++---- xsd/package_format3.xsd | 17 +++++++++++++---- 3 files changed, 39 insertions(+), 12 deletions(-) diff --git a/xsd/package_format1.xsd b/xsd/package_format1.xsd index b07616aa..ae90e881 100644 --- a/xsd/package_format1.xsd +++ b/xsd/package_format1.xsd @@ -30,17 +30,26 @@ + The package name must start with a letter and contain only + lowercase alphabetic, numeric, or underscore characters. The package name should be unique within the ROS community. It may differ from the folder name into which it is checked out, but that is not recommended. - It must start with a lower-case letter and consist of only - lower-case letters, numbers and underscores. - It must not have two consecutive underscores. + + The following recommended exemptions apply, which are optional + for implementations: + - Dashes may be permitted in package names. This is to support + maintaining a consistent dependency name when transitioning back + and forth between a system dependency and in-workspace package, + since many rosdep keys contain dashes (inherited from the + Debian/Ubuntu name). + - In support of some legacy packages, capital letters may also be + accepted in the package name, with a validation warning. - + diff --git a/xsd/package_format2.xsd b/xsd/package_format2.xsd index 73cd9c1f..2e77bb92 100644 --- a/xsd/package_format2.xsd +++ b/xsd/package_format2.xsd @@ -30,17 +30,26 @@ + The package name must start with a letter and contain only + lowercase alphabetic, numeric, or underscore characters. The package name should be unique within the ROS community. It may differ from the folder name into which it is checked out, but that is not recommended. - It must start with a lower-case letter and consist of only - lower-case letters, numbers and underscores. - It must not have two consecutive underscores. + + The following recommended exemptions apply, which are optional + for implementations: + - Dashes may be permitted in package names. This is to support + maintaining a consistent dependency name when transitioning back + and forth between a system dependency and in-workspace package, + since many rosdep keys contain dashes (inherited from the + Debian/Ubuntu name). + - In support of some legacy packages, capital letters may also be + accepted in the package name, with a validation warning. - + diff --git a/xsd/package_format3.xsd b/xsd/package_format3.xsd index c09cd8eb..35f92252 100644 --- a/xsd/package_format3.xsd +++ b/xsd/package_format3.xsd @@ -67,17 +67,26 @@ + The package name must start with a letter and contain only + lowercase alphabetic, numeric, or underscore characters. The package name should be unique within the ROS community. It may differ from the folder name into which it is checked out, but that is not recommended. - It must start with a lower-case letter and consist of only - lower-case letters, numbers and underscores. - It must not have two consecutive underscores. + + The following recommended exemptions apply, which are optional + for implementations: + - Dashes may be permitted in package names. This is to support + maintaining a consistent dependency name when transitioning back + and forth between a system dependency and in-workspace package, + since many rosdep keys contain dashes (inherited from the + Debian/Ubuntu name). + - In support of some legacy packages, capital letters may also be + accepted in the package name, with a validation warning. - +