From e8fbcf6b5c921c99b78f8d99c5a91cd7917c934b Mon Sep 17 00:00:00 2001 From: selfhoster1312 Date: Sun, 8 Jan 2023 19:28:55 +0100 Subject: [PATCH 1/2] Warn when using ynh_script_progression in _common.sh --- package_linter.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/package_linter.py b/package_linter.py index b117fed..06ea0c5 100755 --- a/package_linter.py +++ b/package_linter.py @@ -2660,6 +2660,13 @@ class Script(TestSuite): 'In the context of backup and restore scripts, you should load _common.sh with "source ../settings/scripts/_common.sh"' ) + @test(only=["_common.sh"]) + def no_progress_in_common(self): + if self.contains("ynh_script_progression"): + yield Error( + "You should not use `ynh_script_progression` in _common.sh because it will not work." + ) + def main(): if len(sys.argv) < 2: From cbe1450d67526ae66915ffe44194cb02828500f3 Mon Sep 17 00:00:00 2001 From: selfhoster1312 Date: Sun, 8 Jan 2023 19:46:01 +0100 Subject: [PATCH 2/2] Change error to info and rephrase the message --- package_linter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package_linter.py b/package_linter.py index 06ea0c5..ed45e9b 100755 --- a/package_linter.py +++ b/package_linter.py @@ -2663,8 +2663,8 @@ class Script(TestSuite): @test(only=["_common.sh"]) def no_progress_in_common(self): if self.contains("ynh_script_progression"): - yield Error( - "You should not use `ynh_script_progression` in _common.sh because it will not work." + yield Info( + "You should not use `ynh_script_progression` in _common.sh because it will produce warnings when trying to install the application." )