Skip to content

Commit

Permalink
Merge pull request #199 from ros-infrastructure/allow_dash_in_pkg_names
Browse files Browse the repository at this point in the history
allow dash in catkin package names
  • Loading branch information
dirk-thomas committed Jan 17, 2018
2 parents e990a65 + 60402b1 commit 46a8aa7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
14 changes: 4 additions & 10 deletions src/catkin_pkg/package.py
Expand Up @@ -222,16 +222,10 @@ def validate(self, warnings=None):
if not re.match('^[a-zA-Z0-9][a-zA-Z0-9_-]*$', self.name):
errors.append('Package name "%s" does not follow naming conventions' % self.name)
else:
if self.get_build_type() == 'catkin':
if not re.match('^[a-z][a-z0-9_]*$', self.name):
new_warnings.append(
'Catkin package name "%s" does not follow the naming conventions. It should start with '
'a lower case letter and only contain lower case letters, digits, and underscores.' % self.name)
else:
if not re.match('^[a-z][a-z0-9_-]*$', self.name):
new_warnings.append(
'Non-catkin package name "%s" does not follow the naming conventions. It should start with'
'a lower case letter and only contain lower case letters, digits, underscores, and dashes.' % self.name)
if not re.match('^[a-z][a-z0-9_-]*$', self.name):
new_warnings.append(
'Package name "%s" does not follow the naming conventions. It should start with'
'a lower case letter and only contain lower case letters, digits, underscores, and dashes.' % self.name)

version_regexp = '^[0-9]+\.[0-9]+\.[0-9]+$'
if not self.version:
Expand Down
2 changes: 1 addition & 1 deletion test/test_package.py
Expand Up @@ -191,7 +191,7 @@ def test_validate_package(self):
pack.name = 'bar-bza'
warnings = []
pack.validate(warnings=warnings)
self.assertIn('naming conventions', warnings[0])
self.assertEquals(warnings, [])

pack.name = 'BAR'
warnings = []
Expand Down

0 comments on commit 46a8aa7

Please sign in to comment.