Skip to content
Merged
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
629 changes: 316 additions & 313 deletions .gitignore

Large diffs are not rendered by default.

54 changes: 27 additions & 27 deletions .markdownlint.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# See: https://github.com/DavidAnson/markdownlint

# Unordered list style
MD004:
style: dash

# Disable line length for tables
MD013:
line_length: 120
tables: false

# Ordered list item prefix
MD029:
style: ordered

# Spaces after list markers
MD030:
ul_single: 1
ol_single: 1
ul_multi: 1
ol_multi: 1

MD033: false

# Code block style
MD046:
style: fenced
# See: https://github.com/DavidAnson/markdownlint
# Unordered list style
MD004:
style: dash
# Disable line length for tables
MD013:
line_length: 240
tables: false
# Ordered list item prefix
MD029:
style: ordered
# Spaces after list markers
MD030:
ul_single: 1
ol_single: 1
ul_multi: 1
ol_multi: 1
MD033: false
# Code block style
MD046:
style: fenced
106 changes: 53 additions & 53 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
target-version = "py314"
line-length = 120
src = ["src", "tests", "scripts", "tools"]

exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv"
]

[lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"UP", # pyupgrade
"B", # flake8-bugbear
"SIM", # flake8-simplify
"RUF", # ruff-specific
"RUF001", # 歧义字符(例如全角字母、数字)
"RUF002", # 歧义标点符号(例如全角逗号、句号)
"RUF003", # 歧义空格(例如全角空格)
]

ignore = ["UP006"]

isort = { known-first-party = ["src"] }

per-file-ignores = { "scripts/fix_fullwidth.py" = ["RUF001"] }
target-version = "py314"
line-length = 240
src = ["src", "tests", "scripts", "tools"]
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv"
]
[lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"UP", # pyupgrade
"B", # flake8-bugbear
"SIM", # flake8-simplify
"RUF", # ruff-specific
"RUF001", # 歧义字符(例如全角字母、数字)
"RUF002", # 歧义标点符号(例如全角逗号、句号)
"RUF003", # 歧义空格(例如全角空格)
]
ignore = ["UP006"]
isort = { known-first-party = ["src"] }
per-file-ignores = { "scripts/fix_fullwidth.py" = ["RUF001"] }
6 changes: 1 addition & 5 deletions src/console/commands/results/copy_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@ def execute(self, context: CommandContext) -> CommandResult:
if tool_obj:
copy_to_clipboard(tool_obj.to_func_call())
return CommandResult(success=False, message=f"已成功复制工具{tool_name}的标准调用格式")
warn = (
f"使用{self.__class__.__name__}时, 传入的参数tool({tool})"
f"不存在于工具{context.tool_registry.list_tools()}中"
f"或对应的已注册工具意外被删除"
)
warn = f"使用{self.__class__.__name__}时, 传入的参数tool({tool})不存在于工具{context.tool_registry.list_tools()}中或对应的已注册工具意外被删除"
context.console.print(f"[yellow]{warn}[/yellow]")
warnings.warn(warn, stacklevel=2)

Expand Down
Loading