File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -104,10 +104,19 @@ def rewrite_requirements(t: CWLObjectType) -> None:
104
104
if cls in rewrite :
105
105
r ["class" ] = rewrite [cls ]
106
106
if "hints" in t :
107
- for r in cast (MutableSequence [CWLObjectType ], t ["hints" ]):
108
- cls = cast (str , r ["class" ])
109
- if cls in rewrite :
110
- r ["class" ] = rewrite [cls ]
107
+ for index , r in enumerate (cast (MutableSequence [CWLObjectType ], t ["hints" ])):
108
+ if isinstance (r , MutableMapping ):
109
+ if "class" not in r :
110
+ raise SourceLine (r , None , ValidationException ).makeError (
111
+ "'hints' entry missing required key 'class'."
112
+ )
113
+ cls = cast (str , r ["class" ])
114
+ if cls in rewrite :
115
+ r ["class" ] = rewrite [cls ]
116
+ else :
117
+ raise SourceLine (t ["hints" ], index , ValidationException ).makeError (
118
+ f"'hints' entries must be dictionaries: { type (r )} { r } ."
119
+ )
111
120
if "steps" in t :
112
121
for s in cast (MutableSequence [CWLObjectType ], t ["steps" ]):
113
122
rewrite_requirements (s )
You can’t perform that action at this time.
0 commit comments