From acd883df21ad0f9e2f13374c1f014aea9ad85ce2 Mon Sep 17 00:00:00 2001 From: Marcel Hellwig Date: Mon, 5 Jan 2026 13:14:47 +0100 Subject: [PATCH] ruff: enable PIE lint this just removes needless pass or ... --- media_manager/auth/db.py | 1 - media_manager/movies/service.py | 3 +-- .../abstract_notification_service_provider.py | 7 +++---- .../torrent/download_clients/abstract_download_client.py | 5 ----- media_manager/tv/schemas.py | 1 - media_manager/tv/service.py | 2 -- ruff.toml | 4 ++-- 7 files changed, 6 insertions(+), 17 deletions(-) diff --git a/media_manager/auth/db.py b/media_manager/auth/db.py index e92a100..145e8e4 100644 --- a/media_manager/auth/db.py +++ b/media_manager/auth/db.py @@ -20,7 +20,6 @@ class OAuthAccount(SQLAlchemyBaseOAuthAccountTableUUID, Base): refresh_token: Mapped[Optional[str]] = mapped_column( String(length=4096), nullable=True ) - pass class User(SQLAlchemyBaseUserTableUUID, Base): diff --git a/media_manager/movies/service.py b/media_manager/movies/service.py index 6c38f60..2531171 100644 --- a/media_manager/movies/service.py +++ b/media_manager/movies/service.py @@ -204,7 +204,6 @@ class MovieService: :param metadata_provider: The metadata provider. :return: True if the movie exists, False otherwise. """ - ... @overload def check_if_movie_exists(self, *, movie_id: MovieId) -> bool: @@ -214,7 +213,6 @@ class MovieService: :param movie_id: The ID of the movie. :return: True if the movie exists, False otherwise. """ - ... def check_if_movie_exists( self, @@ -232,6 +230,7 @@ class MovieService: :return: True if the movie exists, False otherwise. :raises ValueError: If neither external ID and metadata provider nor movie ID are provided. """ + if not (external_id is None or metadata_provider is None): try: self.movie_repository.get_movie_by_external_id( diff --git a/media_manager/notification/service_providers/abstract_notification_service_provider.py b/media_manager/notification/service_providers/abstract_notification_service_provider.py index 0700c2e..a4a33e9 100644 --- a/media_manager/notification/service_providers/abstract_notification_service_provider.py +++ b/media_manager/notification/service_providers/abstract_notification_service_provider.py @@ -1,10 +1,10 @@ -import abc +from abc import ABC, abstractmethod from media_manager.notification.schemas import MessageNotification -class AbstractNotificationServiceProvider(abc.ABC): - @abc.abstractmethod +class AbstractNotificationServiceProvider(ABC): + @abstractmethod def send_notification(self, message: MessageNotification) -> bool: """ Sends a notification with the given message. @@ -12,4 +12,3 @@ class AbstractNotificationServiceProvider(abc.ABC): :param message: The message to send in the notification. :return: True if the notification was sent successfully, False otherwise. """ - pass diff --git a/media_manager/torrent/download_clients/abstract_download_client.py b/media_manager/torrent/download_clients/abstract_download_client.py index 08406a2..eecba94 100644 --- a/media_manager/torrent/download_clients/abstract_download_client.py +++ b/media_manager/torrent/download_clients/abstract_download_client.py @@ -23,7 +23,6 @@ class AbstractDownloadClient(ABC): :param torrent: The indexer query result of the torrent file to download. :return: The torrent object with calculated hash and initial status. """ - pass @abstractmethod def remove_torrent(self, torrent: Torrent, delete_data: bool = False) -> None: @@ -33,7 +32,6 @@ class AbstractDownloadClient(ABC): :param torrent: The torrent to remove. :param delete_data: Whether to delete the downloaded data. """ - pass @abstractmethod def get_torrent_status(self, torrent: Torrent) -> TorrentStatus: @@ -43,7 +41,6 @@ class AbstractDownloadClient(ABC): :param torrent: The torrent to get the status of. :return: The status of the torrent. """ - pass @abstractmethod def pause_torrent(self, torrent: Torrent) -> None: @@ -52,7 +49,6 @@ class AbstractDownloadClient(ABC): :param torrent: The torrent to pause. """ - pass @abstractmethod def resume_torrent(self, torrent: Torrent) -> None: @@ -61,4 +57,3 @@ class AbstractDownloadClient(ABC): :param torrent: The torrent to resume. """ - pass diff --git a/media_manager/tv/schemas.py b/media_manager/tv/schemas.py index d40ea3f..1e9b3be 100644 --- a/media_manager/tv/schemas.py +++ b/media_manager/tv/schemas.py @@ -76,7 +76,6 @@ class SeasonRequestBase(BaseModel): class CreateSeasonRequest(SeasonRequestBase): season_id: SeasonId - pass class UpdateSeasonRequest(SeasonRequestBase): diff --git a/media_manager/tv/service.py b/media_manager/tv/service.py index dad7229..01c7bd1 100644 --- a/media_manager/tv/service.py +++ b/media_manager/tv/service.py @@ -207,7 +207,6 @@ class TvService: :param metadata_provider: The metadata provider. :return: True if the show exists, False otherwise. """ - ... @overload def check_if_show_exists(self, *, show_id: ShowId) -> bool: @@ -217,7 +216,6 @@ class TvService: :param show_id: The ID of the show. :return: True if the show exists, False otherwise. """ - ... def check_if_show_exists( self, *, external_id=None, metadata_provider=None, show_id=None diff --git a/ruff.toml b/ruff.toml index 017008a..9bc35ef 100644 --- a/ruff.toml +++ b/ruff.toml @@ -5,7 +5,7 @@ line-ending = "lf" quote-style = "double" [lint] -# to be enabled: ANN, BLE, C90, CPY, D, DOC, DTZ, FBT, G, PIE, PL, PTH, RET, RSE, SLF, SIM, TC, TRY, UP +# to be enabled: ANN, BLE, C90, CPY, D, DOC, DTZ, FBT, G, PL, PTH, RET, RSE, SLF, SIM, TC, TRY, UP extend-select = [ "A", "ARG", "ASYNC", "B", @@ -16,7 +16,7 @@ extend-select = [ "I", "ICN", "INP", "INT", "ISC", "LOG", "N", - "PERF", "PGH", "PT", "PYI", + "PERF", "PGH", "PIE", "PT", "PYI", "Q", "RUF", "S", "SLOT",