diff --git a/.gitignore b/.gitignore index 4e1606a54..e51abc5cc 100644 --- a/.gitignore +++ b/.gitignore @@ -193,9 +193,8 @@ cython_debug/ # jieba jieba.cache - -# vscode -/.vscode +# .vscode +!.vscode/settings.json # direnv /.direnv \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..23fd35f0e --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "editor.formatOnSave": true +} \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index e54dcdacd..1eff99a97 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,23 +1,37 @@ -[project] -name = "Megbot" -version = "0.1.0" -description = "New Bot Project" - -[tool.nonebot] -plugins = ["src.plugins.chat"] -plugin_dirs = ["src/plugins"] - [tool.ruff] -# 设置 Python 版本 -target-version = "py39" +include = ["*.py"] +fixable = ["ALL"] # 启用的规则 select = [ - "E", # pycodestyle 错误 - "F", # pyflakes - "I", # isort - "B", # flake8-bugbear + "E", # pycodestyle 错误 + "F", # pyflakes + "B", # flake8-bugbear ] +ignore = ["E711"] + +# 如果一个变量的名称以下划线开头,即使它未被使用,也不应该被视为错误或警告。 +dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" + # 行长度设置 -line-length = 88 \ No newline at end of file +line-length = 120 + +[tool.ruff.format] +docstring-code-format = true +indent-style = "space" + +# 使用双引号表示字符串 +quote-style = "double" + +# 尊重魔法尾随逗号 +# 例如: +# items = [ +# "apple", +# "banana", +# "cherry", +# ] +skip-magic-trailing-comma = false + +# 自动检测合适的换行符 +line-ending = "auto"