@@ -224,7 +224,7 @@ def __call__(
224224 if isinstance (schema , list ):
225225 return self ._handle_list (schema , prefix , _path )
226226
227- filtered = self ._filter_unecessary (schema , _path )
227+ filtered = self ._filter_unnecessary (schema , _path )
228228 simple = self ._handle_simple_dict (filtered , _path )
229229 if simple :
230230 return f"{ prefix } { simple } "
@@ -239,7 +239,7 @@ def __call__(
239239 buffer .write (f"{ line_prefix } { self ._label (child_path )} :" )
240240 # ^ just the first item should receive the complete prefix
241241 if isinstance (value , dict ):
242- filtered = self ._filter_unecessary (value , child_path )
242+ filtered = self ._filter_unnecessary (value , child_path )
243243 simple = self ._handle_simple_dict (filtered , child_path )
244244 buffer .write (
245245 f" { simple } "
@@ -256,19 +256,19 @@ def __call__(
256256 buffer .write (f" { self ._value (value , child_path )} \n " )
257257 return buffer .getvalue ()
258258
259- def _is_unecessary (self , path : Sequence [str ]) -> bool :
259+ def _is_unnecessary (self , path : Sequence [str ]) -> bool :
260260 if self ._is_property (path ) or not path : # empty path => instruction @ root
261261 return False
262262 key = path [- 1 ]
263263 return any (key .startswith (k ) for k in "$_" ) or key in self ._IGNORE
264264
265- def _filter_unecessary (
265+ def _filter_unnecessary (
266266 self , schema : dict [str , Any ], path : Sequence [str ]
267267 ) -> dict [str , Any ]:
268268 return {
269269 key : value
270270 for key , value in schema .items ()
271- if not self ._is_unecessary ([* path , key ])
271+ if not self ._is_unnecessary ([* path , key ])
272272 }
273273
274274 def _handle_simple_dict (self , value : dict , path : Sequence [str ]) -> str | None :
@@ -281,7 +281,7 @@ def _handle_simple_dict(self, value: dict, path: Sequence[str]) -> str | None:
281281 def _handle_list (
282282 self , schemas : list , prefix : str = "" , path : Sequence [str ] = ()
283283 ) -> str :
284- if self ._is_unecessary (path ):
284+ if self ._is_unnecessary (path ):
285285 return ""
286286
287287 repr_ = repr (schemas )
0 commit comments