Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⬆️ auto update by pre-commit hooks #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,26 @@ ci:
autoupdate_commit_msg: ":arrow_up: auto update by pre-commit hooks"
repos:
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
stages: [commit]
stages: [pre-commit]

- repo: https://github.com/psf/black
rev: 23.9.1
rev: 24.10.0
hooks:
- id: black
stages: [commit]
stages: [pre-commit]

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
rev: v4.0.0-alpha.8
hooks:
- id: prettier
types_or: [markdown, yaml, json]
stages: [commit]
stages: [pre-commit]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -36,7 +36,7 @@ repos:
- id: check-json

- repo: https://github.com/python-poetry/poetry
rev: 1.6.1
rev: 2.0.0
hooks:
- id: poetry-check
- id: poetry-lock
4 changes: 3 additions & 1 deletion nonebot_plugin_roll/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,6 @@ async def _(matcher: Matcher):
if dice_result == 6324:
await matcher.send("彩蛋!6324工作室祝大家新年快乐!")

await matcher.finish(f"你掷出了{dice_num}个{dice_side}面骰子, 点数为【{dice_result}】")
await matcher.finish(
f"你掷出了{dice_num}个{dice_side}面骰子, 点数为【{dice_result}】"
)
12 changes: 9 additions & 3 deletions tests/test_roll.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,23 @@ async def test_roll_legal(app: App):

event = make_event("/掷骰 0d999")
ctx.receive_event(bot, event)
ctx.should_call_send(event, "错误!你掷出了不存在的骰子, 只有上帝知道结果是多少🤔", result=None)
ctx.should_call_send(
event, "错误!你掷出了不存在的骰子, 只有上帝知道结果是多少🤔", result=None
)
ctx.should_finished(roll)

event = make_event("/掷骰 d0")
ctx.receive_event(bot, event)
ctx.should_call_send(event, "错误!你掷出了不存在的骰子, 只有上帝知道结果是多少🤔", result=None)
ctx.should_call_send(
event, "错误!你掷出了不存在的骰子, 只有上帝知道结果是多少🤔", result=None
)
ctx.should_finished(roll)

event = make_event("/rd -1d1")
ctx.receive_event(bot, event)
ctx.should_call_send(event, "错误!你掷出了不存在的骰子, 只有上帝知道结果是多少🤔", result=None)
ctx.should_call_send(
event, "错误!你掷出了不存在的骰子, 只有上帝知道结果是多少🤔", result=None
)
ctx.should_finished(roll)

event = make_event("/rd d1000")
Expand Down