From 657f30a94d6bd5c15acae918e61ffca10208dae3 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 29 Jan 2019 00:36:08 +0100 Subject: [PATCH] Complain if 'yunohost service add' is not matched with a 'yunohost service remove' --- package_linter.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/package_linter.py b/package_linter.py index 8ef7662..05b2294 100755 --- a/package_linter.py +++ b/package_linter.py @@ -373,6 +373,14 @@ def check_helper_consistency(script): except FileNotFoundError: pass + if script["name"] == "install" and "yunohost service add" in script["raw"]: + try: + script2 = read_file_raw(os.path.dirname(script["path"]) + "/remove") + if "yunohost service remove" not in script2: + print_wrong("You used 'yunohost service add' in the install script, but not 'yunohost service remove' in the remove script.") + except FileNotFoundError: + pass + def check_deprecated_practices(script):