From 975e2de5fcd2a3061a3c3527a4fa84b2d3eaf14b Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 15 Mar 2021 02:26:41 +0100 Subject: [PATCH] Add info about osbsolete/superflous ask strings --- package_linter.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/package_linter.py b/package_linter.py index b02cefa..b6b1c4d 100755 --- a/package_linter.py +++ b/package_linter.py @@ -1089,6 +1089,17 @@ class Manifest(TestSuite): "No need to specify the choices list yourself." % argument["name"] ) + @test() + def obsolete_ask_strings(self): + + ask_string_managed_by_the_core = [("domain", "domain"), ("path", "path"), ("admin", "user"), ("is_public", "boolean"), ("password", "password")] + + for argument in self.manifest["arguments"].get("install", []): + + 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 superflous / will be ignored. Since 4.1, the core handles the ask string for some reccuring arg name/type for consistency and easier i18n. See https://github.com/YunoHost/example_ynh/pull/142" % argument.get("name")) + + @test() def is_public_help(self): for argument in self.manifest["arguments"].get("install", []):