diff --git a/planemo/shed_lint.py b/planemo/shed_lint.py index da75faf8f..2f1499cfd 100644 --- a/planemo/shed_lint.py +++ b/planemo/shed_lint.py @@ -312,13 +312,16 @@ def _lint_if_present(key, func, *args): msg = func(value, *args) if msg: lint_ctx.error(msg) - else: + return value + + def _lint(key, func, *args): + if _lint_if_present(key, func, args) is None: lint_ctx.error("Repository does not define: %s" % key) - _lint_if_present("owner", validate_repo_owner) + _lint("owner", validate_repo_owner) _lint_if_present("name", validate_repo_name) - _lint_if_present("type", _validate_repo_type, config["name"]) - _lint_if_present("categories", _validate_categories, realized_repository) + _lint("type", _validate_repo_type, config["name"]) + _lint("categories", _validate_categories, realized_repository) def _validate_repo_type(repo_type, name): diff --git a/tests/data/repos/bad_invalid_tool_xml/.shed.yml b/tests/data/repos/bad_invalid_tool_xml/.shed.yml index 478800f03..e439fa5f3 100644 --- a/tests/data/repos/bad_invalid_tool_xml/.shed.yml +++ b/tests/data/repos/bad_invalid_tool_xml/.shed.yml @@ -1,6 +1,5 @@ name: cat owner: iuc description: cat1 tool -type: unrestricted categories: - Text Manipulation diff --git a/tests/data/repos/multi_repos_nested/cat1/.shed.yml b/tests/data/repos/multi_repos_nested/cat1/.shed.yml index 6311d7561..3a2a1996d 100644 --- a/tests/data/repos/multi_repos_nested/cat1/.shed.yml +++ b/tests/data/repos/multi_repos_nested/cat1/.shed.yml @@ -1,6 +1,5 @@ name: cat1 owner: iuc description: cat1 tool -type: unrestricted categories: - Text Manipulation diff --git a/tests/data/repos/multi_repos_nested/cat2/.shed.yml b/tests/data/repos/multi_repos_nested/cat2/.shed.yml index b244d92cd..f5e39e3c9 100644 --- a/tests/data/repos/multi_repos_nested/cat2/.shed.yml +++ b/tests/data/repos/multi_repos_nested/cat2/.shed.yml @@ -1,6 +1,5 @@ name: cat2 owner: iuc description: cat2 tool -type: unrestricted categories: - Text Manipulation