Skip to content

ignore-pass-statements introduces unnecessary pass statements #206

@yarnabrina

Description

@yarnabrina

If "--ignore-pass-statements" is used, removed imports are being replaced with pass.

>>> import autoflake
>>> 
>>> print(autoflake.__version__)
2.0.0
>>> 
>>> code = """
... import os
... 
... print("hello")
... """
>>> 
>>> fixed_code = autoflake.fix_code(code, ignore_pass_statements=True)
>>> print(fixed_code)

pass

print("hello")

>>> 

This looks like a bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions