mirror of
https://github.com/YunoHost/package_linter.git
synced 2024-09-03 20:06:12 +02:00
make 'doc_dir' test recursive for subfolders
This commit is contained in:
parent
259ebcd127
commit
75b29cfe12
1 changed files with 13 additions and 9 deletions
|
@ -590,20 +590,24 @@ class App(TestSuite):
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
if os.path.exists(app.path + "/doc/screenshots"):
|
if os.path.exists(os.path.join(app.path, "doc/screenshots")):
|
||||||
du_output = subprocess.check_output(["du", "-sb", app.path + "/doc/screenshots"], shell=False)
|
du_output = subprocess.check_output(["du", "-sb", app.path + "/doc/screenshots"], shell=False)
|
||||||
screenshots_size = int(du_output.split()[0])
|
screenshots_size = int(du_output.split()[0])
|
||||||
if screenshots_size > 512000:
|
if screenshots_size > 512000:
|
||||||
yield Info("Consider keeping the content of doc/screenshots under ~512Kb for better UI/UX once the screenshots will be integrated in the webadmin app's catalog (to be discussed with the team)")
|
yield Info("Consider keeping the content of doc/screenshots under ~512Kb for better UI/UX once the screenshots will be integrated in the webadmin app's catalog (to be discussed with the team)")
|
||||||
|
|
||||||
for path in os.listdir(app.path + "/doc/screenshots"):
|
for _, _, files in os.walk(os.path.join(app.path, "doc/screenshots")):
|
||||||
if path == ".gitkeep":
|
for file in files:
|
||||||
continue
|
if file == ".gitkeep":
|
||||||
if os.path.isdir(path):
|
continue
|
||||||
continue
|
if all(
|
||||||
if all(not path.lower().endswith(ext) for ext in [".jpg", ".jpeg", ".png", ".gif", ".webp"]):
|
not file.lower().endswith(ext)
|
||||||
yield Warning("In the doc/screenshots folder, only .jpg, .jpeg, .png, .webp and .gif are accepted")
|
for ext in [".jpg", ".jpeg", ".png", ".gif", ".webp"]
|
||||||
break
|
):
|
||||||
|
yield Warning(
|
||||||
|
"In the doc/screenshots folder, only .jpg, .jpeg, .png, .webp and .gif are accepted"
|
||||||
|
)
|
||||||
|
break
|
||||||
|
|
||||||
@test()
|
@test()
|
||||||
def doc_dir_v2(app):
|
def doc_dir_v2(app):
|
||||||
|
|
Loading…
Add table
Reference in a new issue