Skip to content

Commit

Permalink
add version field check
Browse files Browse the repository at this point in the history
  • Loading branch information
FynnBe committed Oct 17, 2024
1 parent 93ea432 commit b65a3ab
Showing 1 changed file with 28 additions and 7 deletions.
35 changes: 28 additions & 7 deletions bioimageio_collection_backoffice/validate_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,40 @@ def _validate_format_impl(rdf_source: str):
),
)
)
rd.validation_summary.add_detail(
ValidationDetail(
name="Check version field",
status="failed" if rd.version is None else "passed",
errors=(
[
ErrorEntry(
loc=("version",),
msg="missing version (We encourage using '0.1.0' for the initial version.)",
type="error",
)
]
if rd.uploader is None
else []
),
)
)
if rd.license is None:
# some older RDF specs have 'license' as an optional field
rd.validation_summary.add_detail(
ValidationDetail(
name="Check that RDF has a license field",
status="failed" if rd.license is None else "passed",
errors=[
ErrorEntry(
loc=("license",),
msg="missing license field",
type="error",
)
],
errors=(
[
ErrorEntry(
loc=("license",),
msg="missing license field",
type="error",
)
]
if rd.license is None
else []
),
)
)

Expand Down

0 comments on commit b65a3ab

Please sign in to comment.