Skip to content

Deadcode breaks multiline assignments #26

Open
@Freyb

Description

When deadcode detects an unused variable, it only attempts to remove the line of assignment, ignoring any further lines that are connected to the assignment.

Here, I have an assignment that takes the output of a function call that was broken into multiple lines. Deadcode only tries to remove the first line, leaving the second and the third line in place, resulting in a syntactically incorrect file.

-unused_variable = function_call(
     param1, param2, param3
 )

deadcode version: 2.4.1

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions