From 48075f80e3e163f22f9ca80b4349220b126aa094 Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Thu, 13 Dec 2018 22:48:49 +0100 Subject: [PATCH] [enh] Check fail if rm -rf --- package_linter.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package_linter.py b/package_linter.py index 6fa3a4d..a76e4a1 100755 --- a/package_linter.py +++ b/package_linter.py @@ -381,14 +381,14 @@ def check_helper_usage_unix(path, script_name): """ script = read_file(path) - if "rm -rf" in script: - print_warning("You should avoid using `rm -rf`, please use `ynh_secure_remove` instead") + if "rm -rf" in script or "rm -Rf" in script: + print_wrong("[YEP-2.12] You should avoid using `rm -rf`, please use `ynh_secure_remove` instead") if "sed -i" in script: - print_warning("You should avoid using `sed -i`, please use `ynh_replace_string` instead") + print_warning("[YEP-2.12] You should avoid using `sed -i`, please use `ynh_replace_string` instead") if "sudo " in script: - print_warning("You should not need to use `sudo`, the script is being run as root. (If you need to run a command using a specific user, use `ynh_exec_as`)") + print_warning("[YEP-2.12] You should not need to use `sudo`, the script is being run as root. (If you need to run a command using a specific user, use `ynh_exec_as`)") def check_helper_consistency(path, script_name): """