Skip to content

Commit cd69eee

Browse files
committed
fix: updated checking script
1 parent 4a3b053 commit cd69eee

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

tools/checkspecs.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,10 @@ def test_specs(self, uri):
177177
allowed_keys = ['desc', 'genfile', 'xor', 'requires', 'desc',
178178
'nohash', 'argstr', 'position', 'mandatory',
179179
'copyfile', 'usedefault', 'sep', 'hash_files',
180-
'deprecated', 'default', 'min_ver', 'max_ver',
181-
'name_source', 'units']
182-
in_built = ['type', 'copy', 'parent', 'instance_handler']
180+
'deprecated', 'new_name', 'min_ver', 'max_ver',
181+
'name_source', 'keep_extension', 'units']
182+
in_built = ['type', 'copy', 'parent', 'instance_handler',
183+
'comparison_mode', 'array', 'default', 'editor']
183184
bad_specs = []
184185
for c in classes:
185186
__import__(uri)
@@ -198,16 +199,24 @@ def test_specs(self, uri):
198199
for key in trait.__dict__:
199200
if key in in_built:
200201
continue
201-
if key not in allowed_keys + classinst._additional_metadata:
202-
bad_specs.append([uri, c, traitname, key])
202+
parent_metadata = []
203+
if 'parent' in trait.__dict__:
204+
parent_metadata = getattr(trait, 'parent').__dict__.keys()
205+
if key not in allowed_keys + classinst._additional_metadata\
206+
+ parent_metadata:
207+
bad_specs.append([uri, c, 'Inputs', traitname, key])
203208
if not classinst.output_spec:
204209
continue
205210
for traitname, trait in classinst.output_spec().traits(transient=None).items():
206211
for key in trait.__dict__:
207212
if key in in_built:
208213
continue
209-
if key not in allowed_keys + classinst._additional_metadata:
210-
bad_specs.append([uri, c, traitname, key])
214+
parent_metadata = []
215+
if 'parent' in trait.__dict__:
216+
parent_metadata = getattr(trait, 'parent').__dict__.keys()
217+
if key not in allowed_keys + classinst._additional_metadata\
218+
+ parent_metadata:
219+
bad_specs.append([uri, c, 'Outputs', traitname, key])
211220
return bad_specs
212221

213222

0 commit comments

Comments
 (0)