MartinThoma / flake8-simplify

❄ A flake8 plugin that helps you to simplify code
MIT License
187 stars 19 forks source link

[Adjust Rule] missing case with SIM108 #176

Open Borda opened 1 year ago

Borda commented 1 year ago

Desired change

Explanation

this was correctly recognized by ruff nut missing here so in combination with yesqa we had disproportion

Example

This is an example where the mentioned rule(s) would currently be suboptimal: https://github.com/Lightning-AI/lightning/blob/8dac2512733bae034f437334a71e4c114d458a7c/src/lightning/pytorch/trainer/connectors/callback_connector.py#L229

    if _PYTHON_GREATER_EQUAL_3_8_0:
        from importlib.metadata import entry_points

        if _PYTHON_GREATER_EQUAL_3_10_0:  # <-- HERE
            factories = entry_points(group=group)
        else:
            factories = entry_points().get(group, {})  # type: ignore[arg-type]
    else:
        from pkg_resources import iter_entry_points