Skip to content

Commit

Permalink
Merge pull request #41 from Agnes4m/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
⬆️ auto update by pre-commit hooks
  • Loading branch information
Agnes4m authored Mar 3, 2024
2 parents 04eda67 + c87ba1f commit 378eeba
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ci:

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.4
rev: v0.2.0
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand All @@ -19,7 +19,7 @@ repos:
# - id: pyright

- repo: https://github.com/psf/black
rev: 23.10.1
rev: 24.1.1
hooks:
- id: black
stages: [commit]
1 change: 0 additions & 1 deletion nonebot_plugin_l4d2_server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
"""


from nonebot import get_driver, require

require("nonebot_plugin_apscheduler") # noqa: F401
Expand Down
3 changes: 1 addition & 2 deletions nonebot_plugin_l4d2_server/l4d2_file/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@


@up.handle()
async def _():
...
async def _(): ...


@up.got("map_url", prompt="图来")
Expand Down
2 changes: 1 addition & 1 deletion nonebot_plugin_l4d2_server/l4d2_file/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def open_packet(name: str, down_file: Path) -> str:
".7z": unpack_7zfile,
".rar": unpack_rarfile,
}
unpack_func = unpack_funcs.get(ext, None)
unpack_func = unpack_funcs.get(ext)
if not unpack_func:
raise ValueError(f"不支持的拓展名: {ext}")
unpack_func(down_file, down_path)
Expand Down
12 changes: 4 additions & 8 deletions nonebot_plugin_l4d2_server/l4d2_image/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,19 @@


@overload
async def convert_img(img: Image.Image, is_base64: bool = False) -> bytes:
...
async def convert_img(img: Image.Image, is_base64: bool = False) -> bytes: ...


@overload
async def convert_img(img: Image.Image, is_base64: bool = True) -> str:
...
async def convert_img(img: Image.Image, is_base64: bool = True) -> str: ...


@overload
async def convert_img(img: bytes, is_base64: bool = False) -> str:
...
async def convert_img(img: bytes, is_base64: bool = False) -> str: ...


@overload
async def convert_img(img: Path, is_base64: bool = False) -> str:
...
async def convert_img(img: Path, is_base64: bool = False) -> str: ...


async def convert_img(
Expand Down
1 change: 0 additions & 1 deletion nonebot_plugin_l4d2_server/l4d2_push/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ async def send_message(

async def server_is_change():
"""检测服务器是否发生变化"""
...


if scheduler:
Expand Down
4 changes: 3 additions & 1 deletion nonebot_plugin_l4d2_server/l4d2_update/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ async def _():
"更新记录",
"更新记录",
"查看插件最近的更新记录",
detail_des=("介绍:\n查看插件最近的有效Git更新记录\n \n指令:\n- <ft color=(238,120,0)>更新记录</ft>"),
detail_des=(
"介绍:\n查看插件最近的有效Git更新记录\n \n指令:\n- <ft color=(238,120,0)>更新记录</ft>"
),
)
async def send_updatelog_msg(
matcher: Matcher,
Expand Down
8 changes: 6 additions & 2 deletions nonebot_plugin_l4d2_server/l4d2_utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,12 @@ class L4d2Config(BaseModel):
l4_push_interval: int = Field(default=3, alias="定时任务间隔")
l4_push_times: int = Field(default=10, alias="定时任务次数")
l4_connect: bool = Field(default=True, alias="是否在查服命令后加入connect ip")
l4_group_upload: bool = Field(default=False, alias="是否在群里传地图的时候,提示上传服务器")
group_config: Dict[int, L4d2GroupConfig] = Field(default_factory=dict, alias="分群配置")
l4_group_upload: bool = Field(
default=False, alias="是否在群里传地图的时候,提示上传服务器"
)
group_config: Dict[int, L4d2GroupConfig] = Field(
default_factory=dict, alias="分群配置"
)

def update(self, **kwargs):
for key, value in kwargs.items():
Expand Down
16 changes: 12 additions & 4 deletions nonebot_plugin_l4d2_server/l4d2_web/webUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@
label="后台管理用户名",
name="web_username",
value="${web_username}",
labelRemark=Remark(shape="circle", content="登录本后台管理所需要的用户名。"), # noqa: E501
labelRemark=Remark(
shape="circle", content="登录本后台管理所需要的用户名。"
), # noqa: E501
),
InputPassword(
label="后台管理密码",
Expand All @@ -119,7 +121,9 @@
label="字体",
name="l4_font",
value="${l4_font}",
labelRemark=Remark(shape="circle", content="机器人返回图片中文字的字体。"), # noqa: E501
labelRemark=Remark(
shape="circle", content="机器人返回图片中文字的字体。"
), # noqa: E501
),
Switch(
label="是否图片发送单服务器查询",
Expand Down Expand Up @@ -197,7 +201,9 @@
visibleOn="${total_enable}",
joinValues=False,
extractValue=True,
labelRemark=Remark(shape="circle", content="在这里加入的用户,才能上传地图"), # noqa: E501
labelRemark=Remark(
shape="circle", content="在这里加入的用户,才能上传地图"
), # noqa: E501
),
InputTag(
label="坐牢三指令tag",
Expand Down Expand Up @@ -426,7 +432,9 @@
Alert(
level=LevelEnum.info,
className="white-space-pre-wrap",
body=(f"此数据库记录了{NICKNAME}所在服务器下的求生服务器。\n· 功能暂未完善"), # noqa: E501
body=(
f"此数据库记录了{NICKNAME}所在服务器下的求生服务器。\n· 功能暂未完善"
), # noqa: E501
),
server_control,
server_ditail,
Expand Down

0 comments on commit 378eeba

Please sign in to comment.