sarugaku / resolvelib

Resolve abstract dependencies into concrete ones
ISC License
138 stars 31 forks source link

Fix CI: Pin Black version for linting #150

Closed notatallshaw closed 6 months ago

notatallshaw commented 6 months ago

Black 24.1.0 has updated the formatting style and it changes several things in the resolvelib codebase: https://github.com/psf/black/releases/tag/24.1.0

In providers.py it changes:

    class Preference(Protocol):
        def __lt__(self, __other: Any) -> bool:
            ...

To:

    class Preference(Protocol):
        def __lt__(self, __other: Any) -> bool: ...

Which fails the flake8 rule "E704 multiple statements on one line (def)". I am therefore pinning the black version so it does not impact other PRs, and does not fight with flake8. Also in general it makes sense to pin your formatting tool so these breakages don't happen.

I'd also be happy to do a follow up PR that moves the linting and formatting config to ruff if the resolvelib maintainers view this as a good idea.