Misc fixes + some apps are using rm -fR or -Rf instead of -rf, which wasnt caught by linter...

This commit is contained in:
Alexandre Aubin 2020-11-09 15:46:32 +01:00
parent e3dcea7299
commit 4b513b4cd6

View file

@ -792,7 +792,7 @@ class Manifest(TestSuite):
if repo_url.lower() not in [repo_org.lower(), repo_brique.lower()]: if repo_url.lower() not in [repo_org.lower(), repo_brique.lower()]:
if repo_url.lower().startswith("https://github.com/YunoHost-Apps/"): if repo_url.lower().startswith("https://github.com/YunoHost-Apps/"):
yield Warning("The url for this app in the catalog should be ") yield Warning("The url for this app in the catalog should be %s" % repo_org)
else: else:
yield Warning("Consider adding your app to the YunoHost-Apps organization to allow the community to contribute more easily") yield Warning("Consider adding your app to the YunoHost-Apps organization to allow the community to contribute more easily")
@ -1011,11 +1011,13 @@ class Script(TestSuite):
yield Error("'yunohost app checkport' is obsolete!!! Please use 'ynh_find_port' instead.") yield Error("'yunohost app checkport' is obsolete!!! Please use 'ynh_find_port' instead.")
if self.contains("yunohost app initdb"): if self.contains("yunohost app initdb"):
yield Error("'yunohost app initdb' is obsolete!!! Please use 'ynh_mysql_setup_db' instead.") yield Error("'yunohost app initdb' is obsolete!!! Please use 'ynh_mysql_setup_db' instead.")
if self.contains("yunohost tools port-available"):
yield Error("'yunohost tools port-available is obsolete!!! Please use 'ynh_port_available' instead.")
@test() @test()
def safe_rm(self): def safe_rm(self):
if self.contains("rm -rf"): if self.contains("rm -r") or self.contains("rm -R") or self.contains("rm -fr") or self.contains("rm -fR"):
yield Error("You should avoid using 'rm -rf', please use 'ynh_secure_remove' instead") yield Error("You should not be using 'rm -rf', please use 'ynh_secure_remove' instead")
@test() @test()
def nginx_restart(self): def nginx_restart(self):
@ -1034,7 +1036,6 @@ class Script(TestSuite):
" domain=$1 ...) Instead, use name=$YNH_APP_ARG_NAME" " domain=$1 ...) Instead, use name=$YNH_APP_ARG_NAME"
) )
@test(only=["install"]) @test(only=["install"])
def sources_list_tweaking(self): def sources_list_tweaking(self):
if self.contains("/etc/apt/sources.list") \ if self.contains("/etc/apt/sources.list") \