From dfec9f99d1726b3c3a4e9426f50c955fcaddb623 Mon Sep 17 00:00:00 2001 From: 简律纯 Date: Mon, 17 Jun 2024 04:24:14 +0800 Subject: chore(format): ruff lint code --- hydro_roll/cli.py | 8 +++++++- hydro_roll/config.py | 15 +++++++-------- hydro_roll/models/utils.py | 3 ++- hydro_roll/typing.py | 2 +- 4 files changed, 17 insertions(+), 11 deletions(-) (limited to 'hydro_roll') diff --git a/hydro_roll/cli.py b/hydro_roll/cli.py index 1a36348..2588ad8 100644 --- a/hydro_roll/cli.py +++ b/hydro_roll/cli.py @@ -8,6 +8,7 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: from .typing import * + class Atien(object): parser = argparse.ArgumentParser(description="水系终端脚手架") @@ -85,7 +86,12 @@ class Atien(object): print(f"下载包时出错:{package_name}") def build_template(self): - template = input("请选择应用模板(输入数字):\n" "1. 创建轻量应用\n" "2. 创建标准应用\n" "3. 创建开发应用\n") + template = input( + "请选择应用模板(输入数字):\n" + "1. 创建轻量应用\n" + "2. 创建标准应用\n" + "3. 创建开发应用\n" + ) if template == "1": print("选择了轻量应用模板") diff --git a/hydro_roll/config.py b/hydro_roll/config.py index e0789a0..a1b1d8a 100644 --- a/hydro_roll/config.py +++ b/hydro_roll/config.py @@ -83,15 +83,14 @@ class Directory(object): self.current_path = _path def get_dice_dir_list(self, _prefix: str) -> list: - return [ - os.path.join(self.current_path, f'{_prefix}', *dirs) + os.path.join(self.current_path, f"{_prefix}", *dirs) for dirs in [ - ['config'], - ['data'], - ['rules'], - ['scripts'], - ['web', 'frontend'], - ['web', 'backend'], + ["config"], + ["data"], + ["rules"], + ["scripts"], + ["web", "frontend"], + ["web", "backend"], ] ] diff --git a/hydro_roll/models/utils.py b/hydro_roll/models/utils.py index 73e7ba0..9e27307 100644 --- a/hydro_roll/models/utils.py +++ b/hydro_roll/models/utils.py @@ -1,6 +1,7 @@ import difflib import pickle + def find_max_similarity(input_string, string_list): max_similarity = 0 max_string = "" @@ -11,4 +12,4 @@ def find_max_similarity(input_string, string_list): max_similarity = similarity max_string = string - return max_string, max_similarity \ No newline at end of file + return max_string, max_similarity diff --git a/hydro_roll/typing.py b/hydro_roll/typing.py index 876fa92..da83c36 100644 --- a/hydro_roll/typing.py +++ b/hydro_roll/typing.py @@ -31,4 +31,4 @@ T_Plugin = TypeVar("T_Plugin", bound="Plugin") T_Config = TypeVar("T_Config", bound="ConfigModel") T_BotHook = Callable[["Bot"], Awaitable[NoReturn]] -T_EventHook = Callable[[T_Event], Awaitable[NoReturn]] \ No newline at end of file +T_EventHook = Callable[[T_Event], Awaitable[NoReturn]] -- cgit v1.2.3-70-g09d2