@@ -324,41 +324,43 @@ def check_exported_eclass_phase(
324324 yield ShadowedEclassPhase (missing , exported_phases [missing ], pkg = pkg )
325325
326326 def feed (self , pkg ):
327- if pkg .inherit :
328- inherited : set [str ] = set ()
329- inherits : list [tuple [list [str ], int ]] = []
330- for node in bash .cmd_query .captures (pkg .tree .root_node ).get ("call" , ()):
331- name = pkg .node_str (node .child_by_field_name ("name" ))
332- if name == "inherit" :
333- call = pkg .node_str (node )
334- # filter out line continuations and conditional inherits
335- if eclasses := [x for x in call .split ()[1 :] if x in pkg .inherit ]:
336- lineno , _colno = node .start_point
337- if not inherited and eclasses [0 ] == pkg .inherit [0 ]:
338- inherits .append ((eclasses , lineno ))
339-
340- for eclass in eclasses :
341- if eclass not in inherited :
342- inherited .add (eclass )
343- else :
344- yield DuplicateEclassInherit (
345- eclass , line = call , lineno = lineno + 1 , pkg = pkg
346- )
347-
348- yield from self .check_provided_eclasses (pkg , inherits )
349- yield from self .check_user_variables (pkg , inherits )
350- # verify @PRE_INHERIT variable placement
351- yield from self .check_pre_inherits (pkg , inherits )
352- # verify @DEPRECATED variables or functions
353- yield from self .check_deprecated_variables (pkg , inherits )
354- yield from self .check_deprecated_functions (pkg , inherits )
355- yield from self .check_exported_eclass_phase (pkg , inherits )
356-
357- for eclass in pkg .inherit .intersection (self .deprecated_eclasses ):
358- replacement = self .deprecated_eclasses [eclass ]
359- if not isinstance (replacement , str ):
360- replacement = None
361- yield DeprecatedEclass (eclass , replacement , pkg = pkg )
327+ if not pkg .inherit :
328+ return
329+
330+ inherited : set [str ] = set ()
331+ inherits : list [tuple [list [str ], int ]] = []
332+ for node in bash .cmd_query .captures (pkg .tree .root_node ).get ("call" , ()):
333+ name = pkg .node_str (node .child_by_field_name ("name" ))
334+ if name == "inherit" :
335+ call = pkg .node_str (node )
336+ # filter out line continuations and conditional inherits
337+ if eclasses := [x for x in call .split ()[1 :] if x in pkg .inherit ]:
338+ lineno , _colno = node .start_point
339+ if not inherited and eclasses [0 ] == pkg .inherit [0 ]:
340+ inherits .append ((eclasses , lineno ))
341+
342+ for eclass in eclasses :
343+ if eclass not in inherited :
344+ inherited .add (eclass )
345+ else :
346+ yield DuplicateEclassInherit (
347+ eclass , line = call , lineno = lineno + 1 , pkg = pkg
348+ )
349+
350+ yield from self .check_provided_eclasses (pkg , inherits )
351+ yield from self .check_user_variables (pkg , inherits )
352+ # verify @PRE_INHERIT variable placement
353+ yield from self .check_pre_inherits (pkg , inherits )
354+ # verify @DEPRECATED variables or functions
355+ yield from self .check_deprecated_variables (pkg , inherits )
356+ yield from self .check_deprecated_functions (pkg , inherits )
357+ yield from self .check_exported_eclass_phase (pkg , inherits )
358+
359+ for eclass in pkg .inherit .intersection (self .deprecated_eclasses ):
360+ replacement = self .deprecated_eclasses [eclass ]
361+ if not isinstance (replacement , str ):
362+ replacement = None
363+ yield DeprecatedEclass (eclass , replacement , pkg = pkg )
362364
363365
364366class EclassVariableScope (VariableScope , results .EclassResult ):
0 commit comments