mirror of
https://github.com/YunoHost/package_linter.git
synced 2024-09-03 20:06:12 +02:00
[enh] manifest: enhance package_format key check.
- Check point by point and display an error message if a check fail - display success message if all tests succeed.
This commit is contained in:
parent
efeb25584d
commit
59274abbd7
1 changed files with 6 additions and 3 deletions
|
@ -71,9 +71,12 @@ def check_manifest(manifest):
|
||||||
# manifest["maintainer"]["name"]
|
# manifest["maintainer"]["name"]
|
||||||
# manifest["maintainer"]["email"]
|
# manifest["maintainer"]["email"]
|
||||||
# manifest["arguments"]["install"]
|
# manifest["arguments"]["install"]
|
||||||
if "packaging_format" in manifest and isinstance(manifest["packaging_format"], int) == 1 and manifest["packaging_format"] >= 1:
|
pf = 1
|
||||||
print_right("\"packaging_format\" field is good")
|
if "packaging_format" not in manifest: print_wrong("\"packaging_format\" key is missing"); pf = 0
|
||||||
elif "packaging_format" in manifest: print_wrong("\"packaging_format\" field value must be a unsigned integer")
|
if pf == 1 and isinstance(manifest["packaging_format"], int) != 1: print_wrong("\"packaging_format\": value isn't an integer type"); pf = 0
|
||||||
|
if pf == 1 and manifest["packaging_format"] != 1: print_wrong("\"packaging_format\" field: current format value is '1'"); pf = 0
|
||||||
|
if pf == 1: print_right("\"packaging_format\" field is good")
|
||||||
|
|
||||||
if "license" in manifest and manifest["license"] != "free" and manifest["license"] != "non-free":
|
if "license" in manifest and manifest["license"] != "free" and manifest["license"] != "non-free":
|
||||||
print_wrong("You should specify 'free' or 'non-free' software package in the license field.")
|
print_wrong("You should specify 'free' or 'non-free' software package in the license field.")
|
||||||
elif "license" in manifest: print_right("\"licence\" key value is good")
|
elif "license" in manifest: print_right("\"licence\" key value is good")
|
||||||
|
|
Loading…
Reference in a new issue