Enable Ruff B024 (#136088)

This commit is contained in:
Sid 2025-01-20 18:14:50 +01:00 committed by GitHub
parent 3f8f206c53
commit 83b0d5a0b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 4 deletions

View File

@ -2,7 +2,6 @@
from __future__ import annotations from __future__ import annotations
from abc import ABC
from dataclasses import dataclass from dataclasses import dataclass
from typing import Any, cast from typing import Any, cast
@ -102,7 +101,7 @@ class MediaSourceItem:
return cls(hass, domain, identifier, target_media_player) return cls(hass, domain, identifier, target_media_player)
class MediaSource(ABC): class MediaSource:
"""Represents a source of media files.""" """Represents a source of media files."""
name: str | None = None name: str | None = None

View File

@ -2,7 +2,7 @@
from __future__ import annotations from __future__ import annotations
from abc import ABC, abstractmethod from abc import abstractmethod
import asyncio import asyncio
from collections.abc import Awaitable, Callable, Coroutine, Iterable from collections.abc import Awaitable, Callable, Coroutine, Iterable
from dataclasses import dataclass from dataclasses import dataclass
@ -126,7 +126,7 @@ class CollectionEntity(Entity):
"""Handle updated configuration.""" """Handle updated configuration."""
class ObservableCollection[_ItemT](ABC): class ObservableCollection[_ItemT]:
"""Base collection type that can be observed.""" """Base collection type that can be observed."""
def __init__(self, id_manager: IDManager | None) -> None: def __init__(self, id_manager: IDManager | None) -> None:

View File

@ -719,6 +719,7 @@ select = [
"B017", # pytest.raises(BaseException) should be considered evil "B017", # pytest.raises(BaseException) should be considered evil
"B018", # Found useless attribute access. Either assign it to a variable or remove it. "B018", # Found useless attribute access. Either assign it to a variable or remove it.
"B023", # Function definition does not bind loop variable {name} "B023", # Function definition does not bind loop variable {name}
"B024", # `{name}` is an abstract base class, but it has no abstract methods or properties
"B026", # Star-arg unpacking after a keyword argument is strongly discouraged "B026", # Star-arg unpacking after a keyword argument is strongly discouraged
"B032", # Possible unintentional type annotation (using :). Did you mean to assign (using =)? "B032", # Possible unintentional type annotation (using :). Did you mean to assign (using =)?
"B904", # Use raise from to specify exception cause "B904", # Use raise from to specify exception cause