mirror of
https://github.com/maxdorninger/MediaManager.git
synced 2026-04-17 15:43:28 +02:00
ruff: Enable B lint
This commit is contained in:
@@ -36,21 +36,21 @@ target_metadata = Base.metadata
|
||||
|
||||
# this is to keep pycharm from complaining about/optimizing unused imports
|
||||
# noinspection PyStatementEffect
|
||||
(
|
||||
User,
|
||||
OAuthAccount,
|
||||
IndexerQueryResult,
|
||||
Torrent,
|
||||
Show,
|
||||
Season,
|
||||
Episode,
|
||||
SeasonFile,
|
||||
SeasonRequest,
|
||||
Movie,
|
||||
MovieFile,
|
||||
MovieRequest,
|
||||
Notification,
|
||||
)
|
||||
__all__ = [
|
||||
"User",
|
||||
"OAuthAccount",
|
||||
"IndexerQueryResult",
|
||||
"Torrent",
|
||||
"Show",
|
||||
"Season",
|
||||
"Episode",
|
||||
"SeasonFile",
|
||||
"SeasonRequest",
|
||||
"Movie",
|
||||
"MovieFile",
|
||||
"MovieRequest",
|
||||
"Notification",
|
||||
]
|
||||
|
||||
|
||||
# other values from the config, defined by the needs of env.py,
|
||||
|
||||
@@ -47,7 +47,7 @@ def get_movie_by_id(
|
||||
raise HTTPException(
|
||||
status_code=404,
|
||||
detail=f"Movie with ID {movie_id} not found.",
|
||||
)
|
||||
) from None
|
||||
return movie
|
||||
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ class MovieRepository:
|
||||
log.error(f"Integrity error while saving movie {movie.name}: {e}")
|
||||
raise ConflictError(
|
||||
f"Movie with this primary key or unique constraint violation: {e.orig}"
|
||||
)
|
||||
) from e
|
||||
except SQLAlchemyError as e:
|
||||
self.db.rollback()
|
||||
log.error(f"Database error while saving movie {movie.name}: {e}")
|
||||
|
||||
@@ -71,7 +71,7 @@ class NotificationRepository:
|
||||
log.error(f"Could not save notification, Error: {e}")
|
||||
raise ConflictError(
|
||||
f"Notification with id {notification.id} already exists."
|
||||
)
|
||||
) from None
|
||||
return
|
||||
|
||||
def mark_notification_as_read(self, id: NotificationId) -> None:
|
||||
|
||||
@@ -39,7 +39,7 @@ def get_torrent_by_id(
|
||||
except NotFoundError:
|
||||
raise HTTPException(
|
||||
status_code=404, detail=f"Torrent with ID {torrent_id} not found"
|
||||
)
|
||||
) from None
|
||||
return torrent
|
||||
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ def get_show_by_id(
|
||||
raise HTTPException(
|
||||
status_code=404,
|
||||
detail=f"Show with ID {show_id} not found.",
|
||||
)
|
||||
) from None
|
||||
return show
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ def get_season_by_id(
|
||||
raise HTTPException(
|
||||
status_code=404,
|
||||
detail=f"Season with ID {season_id} not found.",
|
||||
)
|
||||
) from None
|
||||
return season
|
||||
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ quote-style = "double"
|
||||
# to be enabled: A, ANN, ARG, BLE, C90, CPY, D, DOC, DTZ, FBT, G, INP, INT, N, PERF, PIE, PL, PTH, RET, RSE, SLF, SIM, TC, TRY, UP
|
||||
extend-select = [
|
||||
"ASYNC",
|
||||
"B",
|
||||
"COM",
|
||||
"E", "EXE",
|
||||
"F", "FA", "FIX", "FLY", "FURB",
|
||||
@@ -25,3 +26,6 @@ ignore = [
|
||||
# lines too long
|
||||
"E501",
|
||||
]
|
||||
|
||||
[lint.flake8-bugbear]
|
||||
extend-immutable-calls = ["fastapi.Depends", "fastapi.Path"]
|
||||
|
||||
Reference in New Issue
Block a user