mirror of
https://github.com/YunoHost/package_linter.git
synced 2024-09-03 20:06:12 +02:00
Add some consistency check for content of check_process compared to manifest
This commit is contained in:
parent
43523543e0
commit
7d5b87ef84
1 changed files with 29 additions and 0 deletions
|
@ -474,6 +474,35 @@ class App(TestSuite):
|
||||||
if os.system("grep -q ' *Level [^5]=' %s" % check_process_file) == 0:
|
if os.system("grep -q ' *Level [^5]=' %s" % check_process_file) == 0:
|
||||||
yield Warning("Setting Level x=y in check_process is obsolete / not relevant anymore")
|
yield Warning("Setting Level x=y in check_process is obsolete / not relevant anymore")
|
||||||
|
|
||||||
|
@test()
|
||||||
|
def check_process_consistency(app):
|
||||||
|
|
||||||
|
check_process_file = app.path + "/check_process"
|
||||||
|
if not file_exists(check_process_file):
|
||||||
|
return
|
||||||
|
|
||||||
|
has_is_public_arg = any(a["name"] == "is_public" for a in app.manifest["arguments"].get("install", []))
|
||||||
|
if has_is_public_arg:
|
||||||
|
if os.system(r"grep -q '^\s*setup_public=1' %s" % check_process_file) != 0:
|
||||||
|
yield Warning("It looks like you forgot to enable setup_public test in check_process ?")
|
||||||
|
|
||||||
|
if os.system(r"grep -q '^\s*setup_private=1' %s" % check_process_file) != 0:
|
||||||
|
yield Warning("It looks like you forgot to enable setup_private test in check_process ?")
|
||||||
|
|
||||||
|
has_path_arg = any(a["name"] == "path" for a in app.manifest["arguments"].get("install", []))
|
||||||
|
if has_path_arg:
|
||||||
|
if os.system(r"grep -q '^\s*setup_sub_dir=1' %s" % check_process_file) != 0:
|
||||||
|
yield Warning("It looks like you forgot to enable setup_sub_dir test in check_process ?")
|
||||||
|
|
||||||
|
if app.manifest.get("multi_instance") in [True, 1, "True", "true"]:
|
||||||
|
if os.system(r"grep -q '^\s*multi_instance=1' %s" % check_process_file) != 0:
|
||||||
|
yield Warning("It looks like you forgot to enable multi_instance test in check_process ?")
|
||||||
|
|
||||||
|
if app.scripts["backup"].exists:
|
||||||
|
if os.system(r"grep -q '^\s*backup_restore=1' %s" % check_process_file) != 0:
|
||||||
|
yield Warning("It looks like you forgot to enable backup_restore test in check_process ?")
|
||||||
|
|
||||||
|
|
||||||
@test()
|
@test()
|
||||||
def misc_legacy_phpini(app):
|
def misc_legacy_phpini(app):
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue