Skip to content

Commit

Permalink
Merge pull request #1437 from bernt-matthias/misc-improvements
Browse files Browse the repository at this point in the history
Misc workflow linting improvements
  • Loading branch information
mvdbeek authored Mar 21, 2024
2 parents f803e2c + 452f530 commit f95f40c
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions planemo/workflow_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,13 @@ def check_json_for_untyped_params(j):

# checks on individual steps
for step in steps.values():
print(step)
# disconnected inputs
for input in step.get("inputs", []):
if input.get("name") not in step.get("input_connections"): # TODO: check optional
lint_context.warn(
f"Input {input.get('name')} of workflow step {step.get('annotation') or step.get('id')} is disconnected."
)
if step.get("type") not in ["data_collection_input", "parameter_input"]:
for input in step.get("inputs", []):
if input.get("name") not in step.get("input_connections"): # TODO: check optional
lint_context.warn(
f"Input {input.get('name')} of workflow step {step.get('annotation') or step.get('id')} is disconnected."
)

# missing metadata
if not step.get("annotation"):
Expand Down Expand Up @@ -334,8 +334,14 @@ def _check_test_assertions(
assertions_valid = False
continue
signature = inspect.signature(function)
function_args = inspect.getfullargspec(function)
assertion_params = assertion_description["attributes"].copy()
if "verify_assertions_function" in function_args:
assertion_params["verify_assertions_function"] = asserts.verify_assertion(b"", [])
if "children" in function_args:
assertion_params["children"] = []
del assertion_params["that"]

try:
# try mapping the function with the attributes supplied and check for TypeError
signature.bind("", **assertion_params)
Expand Down

0 comments on commit f95f40c

Please sign in to comment.