diff --git a/.ruff.toml b/.ruff.toml index 606e32dcb..44e034549 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -32,6 +32,7 @@ ignore = [ "TRY003", "G004", "TRY201", + "FIX002", ] select = [ diff --git a/src/a2a/server/request_handlers/default_request_handler.py b/src/a2a/server/request_handlers/default_request_handler.py index 3c0746d25..25fe25258 100644 --- a/src/a2a/server/request_handlers/default_request_handler.py +++ b/src/a2a/server/request_handlers/default_request_handler.py @@ -293,7 +293,7 @@ async def on_message_send( consumer, blocking=blocking ) if not result: - raise ServerError(error=InternalError()) + raise ServerError(error=InternalError()) # noqa: TRY301 if isinstance(result, Task): self._validate_task_id_match(task_id, result.id) diff --git a/src/a2a/server/request_handlers/jsonrpc_handler.py b/src/a2a/server/request_handlers/jsonrpc_handler.py index 97cff4960..3beb4e4f6 100644 --- a/src/a2a/server/request_handlers/jsonrpc_handler.py +++ b/src/a2a/server/request_handlers/jsonrpc_handler.py @@ -187,7 +187,7 @@ async def on_cancel_task( CancelTaskSuccessResponse, CancelTaskResponse, ) - raise ServerError(error=TaskNotFoundError()) + raise ServerError(error=TaskNotFoundError()) # noqa: TRY301 except ServerError as e: return CancelTaskResponse( root=JSONRPCErrorResponse( @@ -339,7 +339,7 @@ async def on_get_task( GetTaskSuccessResponse, GetTaskResponse, ) - raise ServerError(error=TaskNotFoundError()) + raise ServerError(error=TaskNotFoundError()) # noqa: TRY301 except ServerError as e: return GetTaskResponse( root=JSONRPCErrorResponse( diff --git a/src/a2a/server/tasks/database_push_notification_config_store.py b/src/a2a/server/tasks/database_push_notification_config_store.py index fb541498b..f4a05e6ee 100644 --- a/src/a2a/server/tasks/database_push_notification_config_store.py +++ b/src/a2a/server/tasks/database_push_notification_config_store.py @@ -252,7 +252,7 @@ async def get_info(self, task_id: str) -> list[PushNotificationConfig]: for model in models: try: configs.append(self._from_orm(model)) - except ValueError: + except ValueError: # noqa: PERF203 logger.exception( 'Could not deserialize push notification config for task %s, config %s', model.task_id,