Skip to content

Commit 040a2a5

Browse files
committed
style: add None checks to checker
1 parent d7d8a6a commit 040a2a5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cwltool/checker.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ def check_types(srctype, sinktype, linkMerge, valueFrom):
2626
"""Check if the source and sink types are "pass", "warning", or "exception".
2727
"""
2828

29-
if valueFrom:
29+
if valueFrom is not None:
3030
return "pass"
31-
if not linkMerge:
31+
if linkMerge is None:
3232
if can_assign_src_to_sink(srctype, sinktype, strict=True):
3333
return "pass"
3434
if can_assign_src_to_sink(srctype, sinktype, strict=False):
@@ -39,7 +39,7 @@ def check_types(srctype, sinktype, linkMerge, valueFrom):
3939
_get_type(sinktype), None, None)
4040
if linkMerge == "merge_flattened":
4141
return check_types(merge_flatten_type(_get_type(srctype)), _get_type(sinktype), None, None)
42-
raise WorkflowException(u"Unrecognized linkMerge enu_m '{}'".format(linkMerge))
42+
raise WorkflowException(u"Unrecognized linkMerge enum '{}'".format(linkMerge))
4343

4444

4545
def merge_flatten_type(src):
@@ -179,7 +179,7 @@ def static_checker(workflow_inputs, workflow_outputs, step_inputs, step_outputs,
179179
SourceLine(sink, "type").makeError(
180180
" with sink '%s' of type %s"
181181
% (shortname(sink["id"]), json_dumps(sink["type"])))
182-
if linkMerge:
182+
if linkMerge is not None:
183183
msg += "\n" + SourceLine(sink).makeError(" source has linkMerge method %s" % linkMerge)
184184

185185
warning_msgs.append(msg)
@@ -193,7 +193,7 @@ def static_checker(workflow_inputs, workflow_outputs, step_inputs, step_outputs,
193193
SourceLine(sink, "type").makeError(
194194
" with sink '%s' of type %s"
195195
% (shortname(sink["id"]), json_dumps(sink["type"])))
196-
if linkMerge:
196+
if linkMerge is not None:
197197
msg += "\n" + SourceLine(sink).makeError(" source has linkMerge method %s" % linkMerge)
198198
exception_msgs.append(msg)
199199

0 commit comments

Comments
 (0)