@@ -139,9 +139,7 @@ def _get(self, name, iterargs, condition=False):
139139 f"This can't happen: asked for { name } but nothing provides it."
140140 )
141141
142- def _get_check_dependencies (
143- self , identity : Identity
144- ) -> Union [
142+ def _get_check_dependencies (self , identity : Identity ) -> Union [
145143 Tuple [None , dict ], # Either we got args
146144 Tuple [Subresult , None ], # or we return a Skipped message
147145 ]:
@@ -238,6 +236,17 @@ def _run_check(self, identity: Identity):
238236
239237 @property
240238 def order (self ) -> Tuple [Identity , ...]:
239+ # map old excluded check ids to new ones
240+ _exclude_checks = None
241+ if self ._exclude_checks :
242+ _exclude_checks = []
243+ for excluded in self ._exclude_checks :
244+ if excluded in old_to_new :
245+ self .legacy_checkid_references .add (excluded )
246+ _exclude_checks .append (old_to_new [excluded ])
247+ else :
248+ _exclude_checks .append (excluded )
249+
241250 _order = []
242251 for section in self .profile .sections :
243252 for check in section .checks :
@@ -260,15 +269,13 @@ def order(self) -> Tuple[Identity, ...]:
260269 if not selected_via_legacy_checkid and not selected_via_new_checkid :
261270 continue
262271
263- if self . _exclude_checks :
264- if any (excluded in check .id for excluded in self . _exclude_checks ):
272+ if _exclude_checks :
273+ if any (excluded in check .id for excluded in _exclude_checks ):
265274 continue
266275
267276 if check .id in self .new_to_old :
268277 for legacy in self .new_to_old [check .id ]:
269- if any (
270- excluded in legacy for excluded in self ._exclude_checks
271- ):
278+ if any (excluded in legacy for excluded in _exclude_checks ):
272279 self .legacy_checkid_references .add (legacy )
273280 continue
274281
0 commit comments