Skip to content

Commit c6dec6f

Browse files
committed
fix(ci): make full-repository Ruff checks reproducible
1 parent ab333a6 commit c6dec6f

5 files changed

Lines changed: 10 additions & 7 deletions

File tree

‎.github/workflows/ruff.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ jobs:
1515

1616
- name: Run Ruff Lint
1717
uses: chartboost/ruff-action@v1
18+
with:
19+
version: "0.16.2"

‎pyproject.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ ignore = [
120120
"PLC0415", # 你别管我为什么不在顶层 import
121121
"PLC0105", # 我们已经用 R 表示协变,Q 表示逆变了
122122
"PLR0913", # 参数就那么多的,你用 builder 什么的不是更逆天?
123+
"PLR0917", # Preserve positional arguments in the existing public API.
123124
"SIM108", # 迫真 simplicy
124125
"RUF001", # String contains ambiguous `,` (FULLWIDTH COMMA). Did you mean `,` (COMMA)?
125126
"RUF002", # Docstring contains ambiguous `,` (FULLWIDTH COMMA). Did you mean `,` (COMMA)?

‎src/nonebot_plugin_alconna/builtins/plugins/with/__init__.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import asyncio
2-
import datetime
2+
import datetime as dt
33
import json
44

55
from arclet.alconna import namespace
@@ -55,7 +55,7 @@ async def unset(target: MsgTarget):
5555
await with_.finish("取消设置成功")
5656

5757
@with_.handle()
58-
async def _(name: Match[str], target: MsgTarget, time: Match[datetime.datetime]):
58+
async def _(name: Match[str], target: MsgTarget, time: Match[dt.datetime]):
5959
key = json.dumps(target.dump(only_scope=True), ensure_ascii=False)
6060
if not name.available:
6161
if key not in data:
@@ -66,7 +66,7 @@ async def _(name: Match[str], target: MsgTarget, time: Match[datetime.datetime])
6666
data[key] = name.result
6767
if time.available:
6868
asyncio.get_running_loop().call_later(
69-
abs((time.result - datetime.datetime.now()).total_seconds()), remove, key # noqa: DTZ005
69+
abs((time.result - dt.datetime.now()).total_seconds()), remove, key # noqa: DTZ005
7070
)
7171

7272
await with_.finish("设置前缀成功")

‎src/nonebot_plugin_alconna/matcher.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -954,8 +954,8 @@ def ensure_context(self, bot: Bot, event: Event):
954954

955955
def on_alconna(
956956
command: Alconna | str,
957-
rule: None | Rule | T_RuleChecker = None,
958-
after_rule: None | Rule | T_RuleChecker = None,
957+
rule: Rule | T_RuleChecker | None = None,
958+
after_rule: Rule | T_RuleChecker | None = None,
959959
skip_for_unmatch: bool = True,
960960
auto_send_output: bool | None = None,
961961
aliases: set[str] | tuple[str, ...] | None = None,
@@ -966,7 +966,7 @@ def on_alconna(
966966
use_cmd_start: bool | None = None,
967967
use_cmd_sep: bool | None = None,
968968
response_self: bool | None = None,
969-
permission: None | Permission | T_PermissionChecker = None,
969+
permission: Permission | T_PermissionChecker | None = None,
970970
*,
971971
handlers: list[T_Handler | Dependent] | None = None,
972972
temp: bool = False,

‎src/nonebot_plugin_alconna/uniseg/builder.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class MessageBuilder(Generic[TS], metaclass=ABCMeta):
2929
@abstractmethod
3030
def get_adapter(cls) -> SupportAdapter: ...
3131

32-
def wildcard_build(self, seg: TS) -> Segment | None | list[Segment]:
32+
def wildcard_build(self, seg: TS) -> Segment | list[Segment] | None:
3333
return None
3434

3535
def __init__(self):

0 commit comments

Comments
 (0)