Skip to content

SIM108 autofix removes comments #1719

@twoertwein

Description

@twoertwein
def test(x: int) -> int:
    if x > 0:
        # test test
        abc = x
    else:
        # test test test
        abc = -x
    return abc

ruff --fix # 0.0.213

def test(x: int) -> int:
    abc = x if x > 0 else -x
    return abc

Metadata

Metadata

Assignees

Labels

fixesRelated to suggested fixes for violations

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions