mirror of
https://github.com/YunoHost/package_linter.git
synced 2024-09-03 20:06:12 +02:00
check_files_exist -> misc_file_checks and other tweaks
This commit is contained in:
parent
b089229482
commit
26c383d0b3
1 changed files with 17 additions and 9 deletions
|
@ -93,13 +93,14 @@ class App():
|
||||||
self.scripts = { f: Script(self.path, f) for f in scripts }
|
self.scripts = { f: Script(self.path, f) for f in scripts }
|
||||||
|
|
||||||
|
|
||||||
def check_files_exist(app_path):
|
def misc_file_checks(app_path):
|
||||||
"""
|
|
||||||
Check files exist
|
print_header("MISC FILE CHECKS")
|
||||||
'backup' and 'restore' scripts are not mandatory
|
|
||||||
"""
|
#
|
||||||
|
# Check for recommended and mandatory files
|
||||||
|
#
|
||||||
|
|
||||||
print_header("MISSING FILES")
|
|
||||||
filenames = ("manifest.json", "LICENSE", "README.md",
|
filenames = ("manifest.json", "LICENSE", "README.md",
|
||||||
"scripts/install", "scripts/remove",
|
"scripts/install", "scripts/remove",
|
||||||
"scripts/upgrade",
|
"scripts/upgrade",
|
||||||
|
@ -110,14 +111,21 @@ def check_files_exist(app_path):
|
||||||
if file_exists(app_path + "/" + filename):
|
if file_exists(app_path + "/" + filename):
|
||||||
continue
|
continue
|
||||||
elif filename in non_mandatory:
|
elif filename in non_mandatory:
|
||||||
print_warning(filename)
|
print_warning("Consider adding a file %s" % filename)
|
||||||
else:
|
else:
|
||||||
print_error(filename)
|
print_error("File %s is mandatory" % filename)
|
||||||
|
|
||||||
|
#
|
||||||
# Deprecated php-fpm.ini thing
|
# Deprecated php-fpm.ini thing
|
||||||
|
#
|
||||||
|
|
||||||
if file_exists(app_path + "/conf/php-fpm.ini"):
|
if file_exists(app_path + "/conf/php-fpm.ini"):
|
||||||
print_warning("Using a separate php-fpm.ini file is deprecated. Please merge your php-fpm directives directly in the pool file. (c.f. https://github.com/YunoHost-Apps/nextcloud_ynh/issues/138 )")
|
print_warning("Using a separate php-fpm.ini file is deprecated. Please merge your php-fpm directives directly in the pool file. (c.f. https://github.com/YunoHost-Apps/nextcloud_ynh/issues/138 )")
|
||||||
|
|
||||||
|
#
|
||||||
|
# Deprecated usage of 'add_header' in nginx conf
|
||||||
|
#
|
||||||
|
|
||||||
for filename in os.listdir(app_path + "/conf"):
|
for filename in os.listdir(app_path + "/conf"):
|
||||||
if not os.path.isfile(filename):
|
if not os.path.isfile(filename):
|
||||||
continue
|
continue
|
||||||
|
@ -465,7 +473,7 @@ def main():
|
||||||
|
|
||||||
# Global checks
|
# Global checks
|
||||||
app = App(app_path)
|
app = App(app_path)
|
||||||
check_files_exist(app_path)
|
misc_file_checks(app_path)
|
||||||
check_source_management(app_path)
|
check_source_management(app_path)
|
||||||
check_manifest(app_path)
|
check_manifest(app_path)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue