From 83b0d5a0b9146efc0c8b8b0835e75e4248642fd8 Mon Sep 17 00:00:00 2001 From: Sid <27780930+autinerd@users.noreply.github.com> Date: Mon, 20 Jan 2025 18:14:50 +0100 Subject: [PATCH] Enable Ruff B024 (#136088) --- homeassistant/components/media_source/models.py | 3 +-- homeassistant/helpers/collection.py | 4 ++-- pyproject.toml | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/media_source/models.py b/homeassistant/components/media_source/models.py index 482ed0e855f..53bd8213262 100644 --- a/homeassistant/components/media_source/models.py +++ b/homeassistant/components/media_source/models.py @@ -2,7 +2,6 @@ from __future__ import annotations -from abc import ABC from dataclasses import dataclass from typing import Any, cast @@ -102,7 +101,7 @@ class MediaSourceItem: return cls(hass, domain, identifier, target_media_player) -class MediaSource(ABC): +class MediaSource: """Represents a source of media files.""" name: str | None = None diff --git a/homeassistant/helpers/collection.py b/homeassistant/helpers/collection.py index 08b58aedde4..aef673cb500 100644 --- a/homeassistant/helpers/collection.py +++ b/homeassistant/helpers/collection.py @@ -2,7 +2,7 @@ from __future__ import annotations -from abc import ABC, abstractmethod +from abc import abstractmethod import asyncio from collections.abc import Awaitable, Callable, Coroutine, Iterable from dataclasses import dataclass @@ -126,7 +126,7 @@ class CollectionEntity(Entity): """Handle updated configuration.""" -class ObservableCollection[_ItemT](ABC): +class ObservableCollection[_ItemT]: """Base collection type that can be observed.""" def __init__(self, id_manager: IDManager | None) -> None: diff --git a/pyproject.toml b/pyproject.toml index 88a5410941f..d5674cf7571 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -719,6 +719,7 @@ select = [ "B017", # pytest.raises(BaseException) should be considered evil "B018", # Found useless attribute access. Either assign it to a variable or remove it. "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 "B032", # Possible unintentional type annotation (using :). Did you mean to assign (using =)? "B904", # Use raise from to specify exception cause