Closed pre-commit-ci[bot] closed 1 month ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 99.63%. Comparing base (
1bb98ae
) to head (25995e1
).
Interesting new error:
src/trio/_abc.py:71:7: B024 `Instrument` is an abstract base class, but it has no abstract methods
I think we should silence the lint. It's conceptually an abstract base class and therefore is documented as if it is one.
(Maybe just at that one line. I can imagine scenarios where the lint being tripped is a sign of a bad change.)
Interesting new error:
src/trio/_abc.py:71:7: B024 `Instrument` is an abstract base class, but it has no abstract methods
Ooh, I'm the author of that one in flake8-bugbear! But yeah it has a bunch of known false positives, this being one of them: a class never meant to be instantiated, but subclasses don't have to override any of its methods.
It looks like ruff's description is much more assertive:
Why is this bad?
Abstract base classes are used to define interfaces. If they have no abstract methods, they are not useful.
If the class is not meant to be used as an interface, it should not be an abstract base class. Remove the ABC base class from the class definition, or add an abstract method to the class.
than the original description in flake8-bugbear:
B024: Abstract base class has methods, but none of them are abstract. This is not necessarily an error, but you might have forgotten to add the
@abstractmethod
decorator, potentially in conjunction with@classmethod
,@property
and/or@staticmethod
.
I'll go open an issue
updates: