From 30515d19077e864a34e1ccf745cbad97671c9411 Mon Sep 17 00:00:00 2001 From: shoucandanghehe Date: Tue, 23 Apr 2024 22:52:04 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20ruff=20auto=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io_data_processor/schemas/user_info.py | 2 +- .../top_data_processor/processor.py | 5 ++--- nonebot_plugin_tetris_stats/utils/metrics.py | 20 +++++++++---------- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/nonebot_plugin_tetris_stats/game_data_processor/io_data_processor/schemas/user_info.py b/nonebot_plugin_tetris_stats/game_data_processor/io_data_processor/schemas/user_info.py index bd5450d..6abf5e8 100644 --- a/nonebot_plugin_tetris_stats/game_data_processor/io_data_processor/schemas/user_info.py +++ b/nonebot_plugin_tetris_stats/game_data_processor/io_data_processor/schemas/user_info.py @@ -81,7 +81,7 @@ class SuccessModel(BaseSuccessModel): discord: Discord | None class Distinguishment(BaseModel): - type: str # noqa: A003 + type: str id: str = Field(..., alias='_id') username: str diff --git a/nonebot_plugin_tetris_stats/game_data_processor/top_data_processor/processor.py b/nonebot_plugin_tetris_stats/game_data_processor/top_data_processor/processor.py index c71ba78..ae0d2a6 100644 --- a/nonebot_plugin_tetris_stats/game_data_processor/top_data_processor/processor.py +++ b/nonebot_plugin_tetris_stats/game_data_processor/top_data_processor/processor.py @@ -2,7 +2,7 @@ from contextlib import suppress from dataclasses import dataclass from io import StringIO from re import match -from typing import Literal, NoReturn +from typing import Literal from urllib.parse import urlencode from lxml import etree @@ -87,10 +87,9 @@ class Processor(ProcessorMeta): self.processed_data.user_profile = self.raw_response.user_profile.decode() return self.processed_data.user_profile - async def check_user(self) -> None | NoReturn: + async def check_user(self) -> None: if 'user not found!' in await self.get_user_profile(): raise RequestError('用户不存在!') - return None async def get_user_name(self) -> str: """获取用户名""" diff --git a/nonebot_plugin_tetris_stats/utils/metrics.py b/nonebot_plugin_tetris_stats/utils/metrics.py index 412b6cf..7b53ef7 100644 --- a/nonebot_plugin_tetris_stats/utils/metrics.py +++ b/nonebot_plugin_tetris_stats/utils/metrics.py @@ -144,7 +144,7 @@ class TetrisMetricsProWithLPMADPM(TetrisMetricsBasicWithLPM, TetrisMetricsBaseWi @overload -def get_metrics( # noqa: PLR0913 +def get_metrics( *, pps: Number, lpm: None = None, @@ -157,7 +157,7 @@ def get_metrics( # noqa: PLR0913 @overload -def get_metrics( # noqa: PLR0913 +def get_metrics( *, pps: None = None, lpm: Number, @@ -170,7 +170,7 @@ def get_metrics( # noqa: PLR0913 @overload -def get_metrics( # noqa: PLR0913 +def get_metrics( *, pps: None = None, lpm: None = None, @@ -183,7 +183,7 @@ def get_metrics( # noqa: PLR0913 @overload -def get_metrics( # noqa: PLR0913 +def get_metrics( *, pps: None = None, lpm: None = None, @@ -196,7 +196,7 @@ def get_metrics( # noqa: PLR0913 @overload -def get_metrics( # noqa: PLR0913 +def get_metrics( *, pps: Number, lpm: None = None, @@ -209,7 +209,7 @@ def get_metrics( # noqa: PLR0913 @overload -def get_metrics( # noqa: PLR0913 +def get_metrics( *, pps: None = None, lpm: Number, @@ -222,7 +222,7 @@ def get_metrics( # noqa: PLR0913 @overload -def get_metrics( # noqa: PLR0913 +def get_metrics( *, pps: Number, lpm: None = None, @@ -235,7 +235,7 @@ def get_metrics( # noqa: PLR0913 @overload -def get_metrics( # noqa: PLR0913 +def get_metrics( *, pps: Number, lpm: None = None, @@ -248,7 +248,7 @@ def get_metrics( # noqa: PLR0913 @overload -def get_metrics( # noqa: PLR0913 +def get_metrics( *, pps: None = None, lpm: Number, @@ -261,7 +261,7 @@ def get_metrics( # noqa: PLR0913 @overload -def get_metrics( # noqa: PLR0913 +def get_metrics( *, pps: None = None, lpm: Number,