Skip to content

Commit

Permalink
Update filtering logic for subprocess-shell-false (#324)
Browse files Browse the repository at this point in the history
  • Loading branch information
drdavella authored Mar 1, 2024
1 parent 15dba6b commit 00b594c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/core_codemods/subprocess_shell_false.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ class SubprocessShellFalse(SimpleCodemod, NameResolutionMixin):
IGNORE_ANNOTATIONS = ["S603"]

def leave_Call(self, original_node: cst.Call, updated_node: cst.Call):
if not self.filter_by_path_includes_or_excludes(
self.node_position(original_node)
):
if not self.node_is_selected(original_node):
return updated_node

if self.find_base_name(original_node.func) in self.SUBPROCESS_FUNCS:
Expand All @@ -64,4 +62,4 @@ def leave_Call(self, original_node: cst.Call, updated_node: cst.Call):
[NewArg(name="shell", value="False", add_if_missing=False)],
)
return self.update_arg_target(updated_node, new_args)
return original_node
return updated_node

0 comments on commit 00b594c

Please sign in to comment.