From 72a674939671ff7e10473c1c998255e23c8971cc Mon Sep 17 00:00:00 2001 From: Rikki Date: Mon, 10 Mar 2025 23:04:12 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Ddocker=E9=83=A8?= =?UTF-8?q?=E7=BD=B2=E6=97=B6=E5=8C=BA=E6=8C=87=E5=AE=9A=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 512558558..e61763398 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,7 +19,7 @@ services: mongodb: container_name: mongodb environment: - - tz=Asia/Shanghai + - TZ=Asia/Shanghai # - MONGO_INITDB_ROOT_USERNAME=your_username # - MONGO_INITDB_ROOT_PASSWORD=your_password expose: From 2b2b3429472fbacd11481769318a7a28cf05e30c Mon Sep 17 00:00:00 2001 From: Rikki Date: Mon, 10 Mar 2025 23:04:37 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=20ruff=20?= =?UTF-8?q?=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index 54737d640..3586857f0 100644 --- a/flake.nix +++ b/flake.nix @@ -22,6 +22,7 @@ pythonEnv = pkgs.python3.withPackages ( ps: with ps; [ + ruff pymongo python-dotenv pydantic From 1294c88b148a65daf42ffbff7eaec2dce6b853a8 Mon Sep 17 00:00:00 2001 From: Rikki Date: Tue, 11 Mar 2025 01:31:12 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E6=A0=87?= =?UTF-8?q?=E5=87=86=E5=8C=96=E6=A0=BC=E5=BC=8F=E5=8C=96=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 5 ++--- .vscode/settings.json | 3 +++ pyproject.toml | 46 ++++++++++++++++++++++++++++--------------- 3 files changed, 35 insertions(+), 19 deletions(-) create mode 100644 .vscode/settings.json 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"