mirror of
https://github.com/A-Minos/nonebot-plugin-tetris-stats.git
synced 2026-03-05 05:36:54 +08:00
⬆️ auto update by pre-commit hooks (#532)
* ⬆️ auto update by pre-commit hooks updates: - [github.com/astral-sh/ruff-pre-commit: v0.9.6 → v0.11.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.9.6...v0.11.0) * 🚨 auto fix by pre-commit hooks * 🚨 添加一个 noqa( --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: shoucandanghehe <wallfjjd@gmail.com>
This commit is contained in:
committed by
GitHub
parent
2ef400ca28
commit
90f655259d
@@ -7,7 +7,7 @@ ci:
|
|||||||
autoupdate_commit_msg: ':arrow_up: auto update by pre-commit hooks'
|
autoupdate_commit_msg: ':arrow_up: auto update by pre-commit hooks'
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
rev: v0.9.6
|
rev: v0.11.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff
|
- id: ruff
|
||||||
args: [--fix, --exit-non-zero-on-fix]
|
args: [--fix, --exit-non-zero-on-fix]
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class RecordKey(NamedTuple):
|
|||||||
record_type: RecordType
|
record_type: RecordType
|
||||||
|
|
||||||
def to_records(self) -> Records:
|
def to_records(self) -> Records:
|
||||||
return cast(Records, f'{self.mode_type.value}_{self.record_type.value}')
|
return cast('Records', f'{self.mode_type.value}_{self.record_type.value}')
|
||||||
|
|
||||||
|
|
||||||
class Player:
|
class Player:
|
||||||
@@ -89,7 +89,7 @@ class Player:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def _request_user_parameter(self) -> str:
|
def _request_user_parameter(self) -> str:
|
||||||
return self.user_id or cast(str, self.user_name).lower()
|
return self.user_id or cast('str', self.user_name).lower()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
async def user(self) -> User:
|
async def user(self) -> User:
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ class Player:
|
|||||||
query = {'teaId': self.teaid}
|
query = {'teaId': self.teaid}
|
||||||
else:
|
else:
|
||||||
path = 'getUsernameInfo'
|
path = 'getUsernameInfo'
|
||||||
query = {'username': cast(str, self.user_name)}
|
query = {'username': cast('str', self.user_name)}
|
||||||
raw_user_info = await request.failover_request(
|
raw_user_info = await request.failover_request(
|
||||||
[i / path % query for i in BASE_URL], failover_code=[502], failover_exc=(TimeoutException,)
|
[i / path % query for i in BASE_URL], failover_code=[502], failover_exc=(TimeoutException,)
|
||||||
)
|
)
|
||||||
@@ -91,7 +91,7 @@ class Player:
|
|||||||
if self._user_profile.get(params) is None:
|
if self._user_profile.get(params) is None:
|
||||||
raw_user_profile = await request.failover_request(
|
raw_user_profile = await request.failover_request(
|
||||||
[
|
[
|
||||||
i / 'getProfile' % {'id': self.teaid or cast(str, self.user_name), **other_parameter}
|
i / 'getProfile' % {'id': self.teaid or cast('str', self.user_name), **other_parameter}
|
||||||
for i in BASE_URL
|
for i in BASE_URL
|
||||||
],
|
],
|
||||||
failover_code=[502],
|
failover_code=[502],
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ class SkinManager:
|
|||||||
|
|
||||||
|
|
||||||
class Skin(ABC):
|
class Skin(ABC):
|
||||||
def __new__(cls, *args: Any, **kwargs: Any) -> Self: # noqa: ANN401, ARG003
|
def __new__(cls, *args: Any, **kwargs: Any) -> Self: # noqa: ANN401, ARG004
|
||||||
instance = super().__new__(cls)
|
instance = super().__new__(cls)
|
||||||
SkinManager.register(instance)
|
SkinManager.register(instance)
|
||||||
return instance
|
return instance
|
||||||
|
|||||||
Reference in New Issue
Block a user