From b11535897fe09a02a9483bec7723227a872fdd31 Mon Sep 17 00:00:00 2001 From: Daniel D'Avella Date: Wed, 28 Feb 2024 13:54:35 -0500 Subject: [PATCH] Add filtering logic to use-defusedxml transformation --- src/core_codemods/use_defused_xml.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core_codemods/use_defused_xml.py b/src/core_codemods/use_defused_xml.py index 883d7fb2..add303b5 100644 --- a/src/core_codemods/use_defused_xml.py +++ b/src/core_codemods/use_defused_xml.py @@ -83,6 +83,9 @@ def matching_functions(self) -> dict[str, str]: return _matching_functions def transform_module_impl(self, tree: cst.Module) -> cst.Module: + if not self.node_is_selected(tree): + return tree + visitor = DefusedXmlModifier( self.context, self.file_context,