`4762358` 与 `86d63ab` 两次 CI 均因 `ruff check` 失败而红。 **根因是我的门禁自查方法错了**:用 `ruff check . | tail -1; echo $?` 读到的是 `tail` 的退出码而不是 ruff 的,于是把一次真实的 lint 失败读成了通过——先前声称 的「四道门禁全绿」是基于这个坏掉的检查得出的。已在 ci.yml 的 Gates 步骤就地注明 此坑,并改为逐条分开跑读各自退出码。 三处都是实际问题,非误报: - `client.py:138` PYI034:`__enter__` 的返回注解硬编码为类名,应为 `Self` (子类化后注解会失准) - `test_video.py:58` C408:`dict()` 调用改字面量 - `test_layering.py:85` PIE810:两次 `endswith` 合并为一次元组调用 修复后在与 CI 同构的隔离 venv(同镜像源、同 requirements-dev.txt,实测 ruff 版本与本地一致 0.16.8)逐道复验:secret-scan / format / lint / pytest 四道 退出码均为 0,100 测试全过。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -12,7 +12,7 @@ client,而不是各自再抄一遍鉴权与错误解包——这是把它单
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
from typing import Any
|
||||
from typing import Any, Self
|
||||
|
||||
import httpx
|
||||
|
||||
@@ -135,7 +135,7 @@ class ArkClient:
|
||||
if self._owns_client:
|
||||
self._client.close()
|
||||
|
||||
def __enter__(self) -> ArkClient:
|
||||
def __enter__(self) -> Self:
|
||||
return self
|
||||
|
||||
def __exit__(self, *exc_info: object) -> None:
|
||||
|
||||
Reference in New Issue
Block a user