Report missing ask strings in install questions

This commit is contained in:
Alexandre Aubin 2021-09-29 15:22:43 +02:00
parent 8d9d3afc62
commit 5b6cde0562

View file

@ -1140,7 +1140,7 @@ class Manifest(TestSuite):
)
@test()
def obsolete_ask_strings(self):
def obsolete_or_missing_ask_strings(self):
ask_string_managed_by_the_core = [("domain", "domain"), ("path", "path"), ("admin", "user"), ("is_public", "boolean"), ("password", "password")]
@ -1149,6 +1149,8 @@ class Manifest(TestSuite):
if argument.get("ask") and (argument.get("name"), argument.get("type")) in ask_string_managed_by_the_core:
yield Info("'ask' string for argument %s is superfluous / will be ignored. Since 4.1, the core handles the 'ask' string for some recurring arg name/type for consistency and easier i18n. See https://github.com/YunoHost/example_ynh/pull/142" % argument.get("name"))
elif not argument.get("ask") and (argument.get("name"), argument.get("type")) not in ask_string_managed_by_the_core:
yield Warning("You should add 'ask' strings for argument %s" % argument.get("name"))
@test()
def is_public_help(self):