Skip to content

Commit

Permalink
Topics should be lowercase, even proper names, acronyms and initialis…
Browse files Browse the repository at this point in the history
…ms (#346)
  • Loading branch information
garethsb committed Oct 12, 2021
1 parent fef91f7 commit 9345dda
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hooks/conan-center.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,9 @@ def test(out):
if topic in invalid_topics:
out.warn("The topic '{}' is invalid and should be removed from topics "
"attribute.".format(topic))
if topic != topic.lower():
out.warn("The topic '{}' is invalid; even names and acronyms should be formatted "
"entirely in lowercase.".format(topic))


@raise_if_error_output
Expand Down
8 changes: 8 additions & 0 deletions tests/test_hooks/conan-center/test_invalid_topics.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,11 @@ def test_invalid_topics(self):
output = self.conan(['export', '.', 'name/version@user/channel'])
self.assertIn("WARN: [INVALID TOPICS (KB-H064)] The topic 'conan' is invalid and should be"
" removed from topics attribute.", output)

def test_uppercase_topics(self):
tools.save('conanfile.py', content=self.conanfile.replace('"foobar",', '"foobar", "Baz", "QUX"'))
output = self.conan(['export', '.', 'name/version@user/channel'])
self.assertIn("WARN: [INVALID TOPICS (KB-H064)] The topic 'Baz' is invalid; even names "
"and acronyms should be formatted entirely in lowercase.", output)
self.assertIn("WARN: [INVALID TOPICS (KB-H064)] The topic 'QUX' is invalid; even names "
"and acronyms should be formatted entirely in lowercase.", output)

0 comments on commit 9345dda

Please sign in to comment.