Move license_mentionned_in_readme inside check_manifest

This commit is contained in:
Alexandre Aubin 2019-03-02 01:34:39 +01:00
parent 26c383d0b3
commit a0e435c271

View file

@ -148,13 +148,6 @@ def check_source_management(app_path):
"https://github.com/YunoHost/issues/issues/201#issuecomment-391549262") "https://github.com/YunoHost/issues/issues/201#issuecomment-391549262")
def license_mentionned_in_readme(path):
readme_path = os.path.join(path, 'README.md')
if os.path.isfile(readme_path):
return "LICENSE" in open(readme_path).read()
return False
def check_manifest(path): def check_manifest(path):
manifest = os.path.join(path, 'manifest.json') manifest = os.path.join(path, 'manifest.json')
if not os.path.exists(manifest): if not os.path.exists(manifest):
@ -212,6 +205,12 @@ def check_manifest(path):
print_warning("[YEP-1.2] This app is not registered in official or community applications") print_warning("[YEP-1.2] This app is not registered in official or community applications")
# YEP 1.3 License # YEP 1.3 License
def license_mentionned_in_readme(path):
readme_path = os.path.join(path, 'README.md')
if os.path.isfile(readme_path):
return "LICENSE" in open(readme_path).read()
return False
if "license" in manifest: if "license" in manifest:
for license in manifest['license'].replace('&', ',').split(','): for license in manifest['license'].replace('&', ',').split(','):
code_license = '<code property="spdx:licenseId">' + license + '</code>' code_license = '<code property="spdx:licenseId">' + license + '</code>'