Skip to content

Commit 4ce7cc4

Browse files
lint type only if present
1 parent 5c687a4 commit 4ce7cc4

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

planemo/shed_lint.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,13 +312,16 @@ def _lint_if_present(key, func, *args):
312312
msg = func(value, *args)
313313
if msg:
314314
lint_ctx.error(msg)
315-
else:
315+
return value
316+
317+
def _lint(key, func, *args):
318+
if _lint_if_present(key, func, *args) is None:
316319
lint_ctx.error("Repository does not define: %s" % key)
317320

318-
_lint_if_present("owner", validate_repo_owner)
321+
_lint("owner", validate_repo_owner)
319322
_lint_if_present("name", validate_repo_name)
320-
_lint_if_present("type", _validate_repo_type, config["name"])
321-
_lint_if_present("categories", _validate_categories, realized_repository)
323+
_lint("type", _validate_repo_type, config["name"])
324+
_lint("categories", _validate_categories, realized_repository)
322325

323326

324327
def _validate_repo_type(repo_type, name):
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: cat
22
owner: iuc
33
description: cat1 tool
4-
type: unrestricted
54
categories:
65
- Text Manipulation
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: cat1
22
owner: iuc
33
description: cat1 tool
4-
type: unrestricted
54
categories:
65
- Text Manipulation
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: cat2
22
owner: iuc
33
description: cat2 tool
4-
type: unrestricted
54
categories:
65
- Text Manipulation

0 commit comments

Comments
 (0)