From ddfd8064b6cd818d7b2e9a98dc7c93874dd71f30 Mon Sep 17 00:00:00 2001 From: Gareth Sylvester-Bradley Date: Mon, 13 Sep 2021 11:21:48 +0100 Subject: [PATCH] Topics should be lowercase, even proper names, acronyms and initialisms --- hooks/conan-center.py | 3 +++ tests/test_hooks/conan-center/test_invalid_topics.py | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/hooks/conan-center.py b/hooks/conan-center.py index a5f55037..7fcefedf 100644 --- a/hooks/conan-center.py +++ b/hooks/conan-center.py @@ -748,6 +748,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 diff --git a/tests/test_hooks/conan-center/test_invalid_topics.py b/tests/test_hooks/conan-center/test_invalid_topics.py index ef15fa28..0649fa64 100644 --- a/tests/test_hooks/conan-center/test_invalid_topics.py +++ b/tests/test_hooks/conan-center/test_invalid_topics.py @@ -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)