Skip to content

Commit

Permalink
👷 使用官方的 ruff-action
Browse files Browse the repository at this point in the history
  • Loading branch information
AzideCupric committed Dec 11, 2024
1 parent 0ccbcf4 commit 12fc3f1
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 15 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,10 @@ jobs:
- uses: actions/checkout@v4

- name: Run Ruff Lint
uses: chartboost/ruff-action@v1
uses: astral-sh/ruff-action@v2
with:
src: >-
nonebot_bison/
extra_plugins/
tests/
bot.py
6 changes: 3 additions & 3 deletions nonebot_bison/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@
"admin_page",
"bootstrap",
"config",
"sub_manager",
"platform",
"post",
"scheduler",
"send",
"platform",
"sub_manager",
"theme",
"types",
"utils",
"theme",
]
2 changes: 1 addition & 1 deletion nonebot_bison/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from nonebot.compat import PYDANTIC_V2
from pydantic import BaseModel

__all__ = ("model_validator", "model_rebuild")
__all__ = ("model_rebuild", "model_validator")


if PYDANTIC_V2:
Expand Down
2 changes: 1 addition & 1 deletion nonebot_bison/config/subs_io/nbesf_model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
from . import v1, v2, v3
from .base import NBESFBase

__all__ = ["v1", "v2", "v3", "NBESFBase"]
__all__ = ["NBESFBase", "v1", "v2", "v3"]
2 changes: 1 addition & 1 deletion nonebot_bison/scheduler/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from .manager import handle_delete_target, handle_insert_new_target, init_scheduler, scheduler_dict

__all__ = ["init_scheduler", "handle_delete_target", "handle_insert_new_target", "scheduler_dict"]
__all__ = ["handle_delete_target", "handle_insert_new_target", "init_scheduler", "scheduler_dict"]
12 changes: 6 additions & 6 deletions nonebot_bison/sub_manager/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,14 @@ async def send_no_permission():


__all__ = [
"common_platform",
"add_cookie_matcher",
"add_cookie_target_matcher",
"add_sub_matcher",
"query_sub_matcher",
"common_platform",
"del_cookie_matcher",
"del_cookie_target_matcher",
"del_sub_matcher",
"group_manage_matcher",
"no_permission_matcher",
"add_cookie_matcher",
"add_cookie_target_matcher",
"del_cookie_target_matcher",
"del_cookie_matcher",
"query_sub_matcher",
]
4 changes: 2 additions & 2 deletions tests/platforms/test_bilibili.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ async def test_dynamic_forward(bilibili: "Bilibili", bing_dy_list: list):
"「2024明日方舟音律联觉-不觅浪尘」将于12:00正式开启预售票!预售票购票链接:https://m.damai.cn/shows/item.html?itemId=778626949623"
)
assert post.url == "https://t.bilibili.com/917092495452536836"
assert (rp := post.repost) # noqa: RUF018
assert (rp := post.repost)
assert rp.content == (
"互动抽奖 #明日方舟##音律联觉#\n\n"
"「2024音律联觉」票务信息公开!\n\n\n\n"
Expand Down Expand Up @@ -413,7 +413,7 @@ async def test_dynamic_forword_deleted(bilibili: "Bilibili", bing_dy_list: list)
post: Post = await bilibili.parse(bing_dy_list[12])
assert post.content == "转发动态"
assert post.url == "https://t.bilibili.com/965806534205374473"
assert (repost := post.repost) # noqa: RUF018
assert (repost := post.repost)
assert repost.url is None
assert not repost.title
assert repost.content == "源动态已被作者删除"
Expand Down

0 comments on commit 12fc3f1

Please sign in to comment.