Skip to content

Commit

Permalink
add filter
Browse files Browse the repository at this point in the history
  • Loading branch information
clavedeluna committed Jan 3, 2024
1 parent 2355535 commit c231fec
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core_codemods/remove_module_global.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ class RemoveModuleGlobal(BaseCodemod, NameResolutionMixin):
def leave_Global(
self, original_node: cst.Global, _
) -> Union[cst.Global, cst.RemovalSentinel,]:
if not self.filter_by_path_includes_or_excludes(
self.node_position(original_node)
):
return original_node
scope = self.get_metadata(ScopeProvider, original_node)
if isinstance(scope, GlobalScope):
self.report_change(original_node)
Expand Down

0 comments on commit c231fec

Please sign in to comment.