@@ -183,7 +183,7 @@ def etool_to_cltool(
183
183
contents += "\n " + "\n " .join (expressionLib )
184
184
contents += (
185
185
"""
186
- var ret = function(){"""
186
+ var ret = function(){"""
187
187
+ escape_expression_field (etool .expression .strip ()[2 :- 1 ])
188
188
+ """}();
189
189
process.stdout.write(JSON.stringify(ret));"""
@@ -389,7 +389,7 @@ def generate_etool_from_expr(
389
389
expression += "\n var self=inputs.self;"
390
390
expression += (
391
391
"""
392
- return {"result": function(){"""
392
+ return {"result": function(){"""
393
393
+ expr [2 :- 2 ]
394
394
+ """}()};
395
395
}"""
@@ -747,7 +747,8 @@ def process_workflow_reqs_and_hints(
747
747
"""
748
748
# TODO: consolidate the generated etools/cltools into a single "_expression_workflow_reqs" step
749
749
# TODO: support resourceReq.* references to Workflow.inputs?
750
- # ^ By refactoring replace_expr_etool to allow multiple inputs, and connecting all workflow inputs to the generated step
750
+ # ^ By refactoring replace_expr_etool to allow multiple inputs,
751
+ # and connecting all workflow inputs to the generated step
751
752
modified = False
752
753
inputs = empty_inputs (workflow )
753
754
generated_res_reqs : List [Tuple [str , Union [int , str ]]] = []
@@ -932,7 +933,8 @@ def process_workflow_reqs_and_hints(
932
933
raise_type = WorkflowException ,
933
934
).makeError (
934
935
f"Entry { index } ,"
935
- + "Invalid CWL, if 'entry' is a string, then entryName must be specified."
936
+ + "Invalid CWL, if 'entry' "
937
+ "is a string, then entryName must be specified."
936
938
)
937
939
expr = (
938
940
'${return {"class": "File", "basename": "'
@@ -1074,7 +1076,8 @@ def process_level_reqs(
1074
1076
# - Replace the CWL Expression inplace with a CWL parameter reference
1075
1077
# - Don't create a new Requirement, nor delete the existing Requirement
1076
1078
# - the Process is passed to replace_expr_with_etool for later searching for JS expressionLibs
1077
- # - in addition to adding the input to the step for the ETool/CTool result, add it to the Process.inputs as well
1079
+ # - in addition to adding the input to the step for the ETool/CTool result,
1080
+ # add it to the Process.inputs as well
1078
1081
if not process .requirements :
1079
1082
return False
1080
1083
modified = False
@@ -1217,7 +1220,7 @@ def process_level_reqs(
1217
1220
entryname = (
1218
1221
entry .entryname
1219
1222
if entryname_expr
1220
- else f'"{ entry .entryname } "'
1223
+ else f'"{ entry .entryname } "' # noqa: B907
1221
1224
)
1222
1225
new_expression = (
1223
1226
"${var result; var entryname = "
@@ -1811,7 +1814,7 @@ def generate_etool_from_expr2(
1811
1814
expression += f"\n var self=inputs.{ self_name } ;"
1812
1815
expression += (
1813
1816
"""
1814
- return {"result": function(){"""
1817
+ return {"result": function(){"""
1815
1818
+ expr [2 :- 2 ]
1816
1819
+ """}()};
1817
1820
}"""
0 commit comments