From 28c515fe5e3614018753a3c40825d7df307f1b14 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 13 Nov 2021 19:24:56 +0100 Subject: [PATCH] Report usage of ynh_exec_* and wrapping the command between quotes --- package_linter.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/package_linter.py b/package_linter.py index ddb247d..359538a 100755 --- a/package_linter.py +++ b/package_linter.py @@ -2005,10 +2005,16 @@ class Script(TestSuite): "Please consider using 'ynh_add_config' to handle config files instead of gazillions of manual cp + 'ynh_replace_string' + chmod" ) + @test() + def bad_ynh_exec_syntax(self): + cmd = 'grep -q -IhEro "ynh_exec_(err|warn|warn_less|quiet|fully_quiet) (\\"|\')" %s' % self.path + if os.system(cmd) == 0: + yield Info("(Requires Yunohost 4.3) When using ynh_exec_*, please don't wrap your command between quotes (typically DONT write ynh_exec_warn_less 'foo --bar --baz')") + @test() def ynh_add_fpm_config_deprecated_package_option(self): if self.containsregex(r'ynh_add_fpm_config .*package=.*'): - yield Info("Since Yunohost 4.3, option --package for ynh_add_fpm_config is deprecated : please use 'ynh_install_app_dependencies' with **all** your apt dependencies instead (no need to define a special 'extra_php_dependencies'). YunoHost will automatically install any phpX.Y-fpm / phpX.Y-common if needed.") + yield Info("(Requires Yunohost 4.3) Option --package for ynh_add_fpm_config is deprecated : please use 'ynh_install_app_dependencies' with **all** your apt dependencies instead (no need to define a special 'extra_php_dependencies'). YunoHost will automatically install any phpX.Y-fpm / phpX.Y-common if needed.") @test() def set_is_public_setting(self):