From 1775202a2666aca9f0bd9ac7625e9a07bc36caba Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 31 Mar 2020 04:30:57 +0200 Subject: [PATCH] Only check for ssowatconf at the end of the file, which is typically where it's useless --- package_linter.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package_linter.py b/package_linter.py index 682c142..e3b27e1 100755 --- a/package_linter.py +++ b/package_linter.py @@ -596,8 +596,14 @@ class Script(): print_warning("'yunohost app initdb' is deprecated. Please use 'ynh_mysql_setup_db' instead.") if self.contains("exit"): print_warning("'exit' command shouldn't be used. Please use 'ynh_die' instead.") + + # Dirty hack to check only the 10 last lines for ssowatconf + # (the "bad" practice being using this at the very end of the script, but some apps legitimately need this in the middle of the script) + oldlines = list(self.lines) + self.lines = self.lines[-10:] if self.contains("yunohost app ssowatconf"): print_warning("You probably don't need to run 'yunohost app ssowatconf' in the app script. It's supposed to be ran automatically after the script.") + self.lines = oldlines if self.contains("rm -rf"): print_error("[YEP-2.12] You should avoid using 'rm -rf', please use 'ynh_secure_remove' instead")