Skip to content

Commit 9345dda

Browse files
authored
Topics should be lowercase, even proper names, acronyms and initialisms (#346)
1 parent fef91f7 commit 9345dda

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

hooks/conan-center.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,9 @@ def test(out):
720720
if topic in invalid_topics:
721721
out.warn("The topic '{}' is invalid and should be removed from topics "
722722
"attribute.".format(topic))
723+
if topic != topic.lower():
724+
out.warn("The topic '{}' is invalid; even names and acronyms should be formatted "
725+
"entirely in lowercase.".format(topic))
723726

724727

725728
@raise_if_error_output

tests/test_hooks/conan-center/test_invalid_topics.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,11 @@ def test_invalid_topics(self):
3535
output = self.conan(['export', '.', 'name/version@user/channel'])
3636
self.assertIn("WARN: [INVALID TOPICS (KB-H064)] The topic 'conan' is invalid and should be"
3737
" removed from topics attribute.", output)
38+
39+
def test_uppercase_topics(self):
40+
tools.save('conanfile.py', content=self.conanfile.replace('"foobar",', '"foobar", "Baz", "QUX"'))
41+
output = self.conan(['export', '.', 'name/version@user/channel'])
42+
self.assertIn("WARN: [INVALID TOPICS (KB-H064)] The topic 'Baz' is invalid; even names "
43+
"and acronyms should be formatted entirely in lowercase.", output)
44+
self.assertIn("WARN: [INVALID TOPICS (KB-H064)] The topic 'QUX' is invalid; even names "
45+
"and acronyms should be formatted entirely in lowercase.", output)

0 commit comments

Comments
 (0)