mirror of
https://github.com/YunoHost/package_linter.git
synced 2024-09-03 20:06:12 +02:00
Fix regressions
This commit is contained in:
parent
89a9eb3f73
commit
961e0bce9f
1 changed files with 14 additions and 8 deletions
|
@ -614,14 +614,20 @@ class Manifest(TestSuite):
|
||||||
@test()
|
@test()
|
||||||
def mandatory_fields(self):
|
def mandatory_fields(self):
|
||||||
|
|
||||||
fields = ("name", "id", "packaging_format", "description", "url", "version",
|
fields = ("name", "id", "packaging_format", "description", "version",
|
||||||
"license", "maintainer", "requirements", "multi_instance",
|
"maintainer", "requirements", "multi_instance",
|
||||||
"services", "arguments")
|
"services", "arguments")
|
||||||
missing_fields = [field for field in fields if field not in self.manifest.keys()]
|
missing_fields = [field for field in fields if field not in self.manifest.keys()]
|
||||||
|
|
||||||
if missing_fields:
|
if missing_fields:
|
||||||
yield Error("The following mandatory fields are missing: %s" % missing_fields)
|
yield Error("The following mandatory fields are missing: %s" % missing_fields)
|
||||||
|
|
||||||
|
fields = ("license", "url")
|
||||||
|
missing_fields = [field for field in fields if field not in self.manifest.keys()]
|
||||||
|
|
||||||
|
if missing_fields:
|
||||||
|
yield Warning("The following mandatory fields are missing: %s" % missing_fields)
|
||||||
|
|
||||||
@test()
|
@test()
|
||||||
def yunohost_version_requirement(self):
|
def yunohost_version_requirement(self):
|
||||||
|
|
||||||
|
@ -645,7 +651,7 @@ class Manifest(TestSuite):
|
||||||
return
|
return
|
||||||
|
|
||||||
def license_mentionned_in_readme():
|
def license_mentionned_in_readme():
|
||||||
readme_path = os.path.join(app.path, 'README.md')
|
readme_path = os.path.join(self.path, 'README.md')
|
||||||
if os.path.isfile(readme_path):
|
if os.path.isfile(readme_path):
|
||||||
return "LICENSE" in open(readme_path).read()
|
return "LICENSE" in open(readme_path).read()
|
||||||
return False
|
return False
|
||||||
|
@ -674,13 +680,13 @@ class Manifest(TestSuite):
|
||||||
|
|
||||||
|
|
||||||
@test()
|
@test()
|
||||||
def app_in_app_list(self):
|
def app_in_app_catalog(self):
|
||||||
|
|
||||||
if self.manifest["id"] not in app_list():
|
if self.manifest["id"] not in app_list():
|
||||||
yield Error("This app is not Yunohost's application catalog")
|
yield Warning("This app is not Yunohost's application catalog")
|
||||||
|
|
||||||
@test()
|
@test()
|
||||||
def app_in_app_list(self):
|
def app_in_github_org(self):
|
||||||
|
|
||||||
all_urls = [infos.get("url", "").lower() for infos in app_list().values()]
|
all_urls = [infos.get("url", "").lower() for infos in app_list().values()]
|
||||||
|
|
||||||
|
@ -696,7 +702,7 @@ class Manifest(TestSuite):
|
||||||
return urlopen(repo_brique)['code'] != 404
|
return urlopen(repo_brique)['code'] != 404
|
||||||
|
|
||||||
if not is_in_github_org() and not is_in_brique_org():
|
if not is_in_github_org() and not is_in_brique_org():
|
||||||
yield Error("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")
|
||||||
|
|
||||||
@test()
|
@test()
|
||||||
def description(self):
|
def description(self):
|
||||||
|
@ -743,7 +749,7 @@ class Manifest(TestSuite):
|
||||||
|
|
||||||
@test()
|
@test()
|
||||||
def url(self):
|
def url(self):
|
||||||
if self.manifest["url"].endswith("_ynh"):
|
if self.manifest.get("url", "").endswith("_ynh"):
|
||||||
yield Warning(
|
yield Warning(
|
||||||
"'url' is not meant to be the url of the yunohost package, "
|
"'url' is not meant to be the url of the yunohost package, "
|
||||||
"but rather the website or repo of the upstream app itself..."
|
"but rather the website or repo of the upstream app itself..."
|
||||||
|
|
Loading…
Reference in a new issue