♻️ Refactor (#318)

* 🔧 启用一些 ruff 的新规则

*  添加开发依赖 nonebot-adapter-qq

*  添加依赖 nonebot-plugin-session

*  添加依赖 nonebot-plugin-session-orm

* 🔧 忽略 ruff 规则 ISC001
format 冲突风险

* 🚨 修复 ruff 警报

* ♻️ 重构!

* ♻️ 恢复定时获取 TetraLeague 数据的功能

*  统一处理需要捕获的错误

*  记录用户触发的指令
This commit is contained in:
呵呵です
2024-05-14 15:03:46 +08:00
committed by GitHub
parent e6c3a32532
commit c8832bd1c9
79 changed files with 2629 additions and 2174 deletions

View File

@@ -11,36 +11,39 @@ license = 'AGPL-3.0'
[tool.poetry.dependencies]
python = '^3.10'
nonebot2 = { extras = ["fastapi"], version = "^2.3.0" }
lxml = '^5.1.0'
pandas = '>=1.4.3,<3.0.0'
playwright = '^1.41.2'
ujson = '^5.9.0'
aiofiles = "^23.2.1"
nonebot-plugin-orm = ">=0.1.1,<0.8.0"
nonebot-plugin-localstore = "^0.6.0"
httpx = "^0.27.0"
nonebot-plugin-alconna = ">=0.40"
nonebot-plugin-apscheduler = "^0.4.0"
aiocache = "^0.12.2"
zstandard = "^0.22.0"
jinja2 = "^3.1.3"
nonebot-plugin-localstore = "^0.6.0"
nonebot-plugin-orm = ">=0.1.1,<0.8.0"
nonebot-plugin-session = "^0.3.1"
nonebot-plugin-session-orm = "^0.2.0"
nonebot-plugin-userinfo = "^0.2.4"
aiocache = "^0.12.2"
aiofiles = "^23.2.1"
httpx = "^0.27.0"
jinja2 = "^3.1.3"
lxml = '^5.1.0'
pandas = '>=1.4.3,<3.0.0'
pillow = "^10.3.0"
playwright = '^1.41.2'
rich = "^13.7.1"
ujson = '^5.9.0'
zstandard = "^0.22.0"
[tool.poetry.group.dev.dependencies]
mypy = '>=1.9'
types-ujson = '^5.9.0'
pandas-stubs = '>=1.5.2,<3.0.0'
ruff = '>=0.3.0'
types-aiofiles = "^23.2.0.20240106"
types-lxml = "^2024.2.9"
nonebot-plugin-orm = { extras = ["default"], version = ">=0.3,<0.8" }
nonebot-adapter-onebot = "^2.4.1"
nonebot-adapter-satori = "^0.11.4"
nonebot-adapter-kaiheila = "^0.3.4"
nonebot-adapter-discord = "^0.1.3"
types-pillow = "^10.2.0.20240423"
types-ujson = '^5.9.0'
pandas-stubs = '>=1.5.2,<3.0.0'
nonebot-plugin-orm = { extras = ["default"], version = ">=0.3,<0.8" }
nonebot-adapter-discord = "^0.1.3"
nonebot-adapter-kaiheila = "^0.3.4"
nonebot-adapter-onebot = "^2.4.1"
nonebot-adapter-qq = "^1.4.4"
nonebot-adapter-satori = "^0.11.4"
[tool.poetry.group.debug.dependencies]
objprint = '^0.2.2'
@@ -59,6 +62,7 @@ select = [
'F', # pyflakes
'E', # pycodestyle errors
'W', # pycodestyle warnings
'C90', # mccabe
'I', # isort
'N', # PEP8-naming
'UP', # pyupgrade
@@ -70,22 +74,33 @@ select = [
'FBT', # flake8-boolean-trap
'B', # flake8-bugbear
'A', # flake8-builtins
'COM', # flake8-commas
'C4', # flake8-comprehensions
'DTZ', # flake8-datetimez
'T10', # flake8-debugger
'EM', # flake8-errmsg
'FA', # flake8-future-annotations
'ISC', # flake8-implicit-str-concat
'ICN', # flake8-import-conventions
'PIE', # flake8-pie
'T20', # flake8-print
'Q', # flake8-quotes
'RSE', # flake8-raise
'RET', # flake8-return
'SLF', # flake8-self
'SIM', # flake8-simplify
'TID', # flake8-tidy-imports
'TCH', # flake8-type-checking
'ARG', # flake8-unused-arguments
'PTH', # flake8-use-pathlib
'ERA', # eradicate
'PD', # pandas-vet
'PGH', # pygrep-hooks
'PL', # pylint
'TRY', # tryceratops
'FLY', # flynt
'PERF', # Perflint
'FURB', # refurb
'RUF', # Ruff-specific rules
]
ignore = [
@@ -94,6 +109,9 @@ ignore = [
'ANN102', # 由 type checker 自动推断
'ANN202', # 向 NoneBot 注册的函数
'TRY003',
'COM812', # 强制尾随逗号
'TID252', # 相对导入
'ISC001', # format warning
]
flake8-quotes = { inline-quotes = 'single', multiline-quotes = 'double' }