Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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