@@ -33,10 +33,10 @@ build-backend = "pdm.backend"
3333[tool .pdm ]
3434[tool .pdm .dev-dependencies ]
3535dev = [
36- " isort>=5.13.2 " ,
37- " black>=24.4.2 " ,
36+ " isort!=6.0.0 " ,
37+ " black>=25.1.0 " ,
3838 " loguru>=0.7.2" ,
39- " ruff>=0.4.2 " ,
39+ " ruff>=0.8.4 " ,
4040 " nonemoji>=0.1.4" ,
4141 " pre-commit>=3.7.0" ,
4242 " nonebug>=0.3.7" ,
@@ -52,12 +52,13 @@ dev = [
5252 " nonebot-adapter-dodo>=0.2.1" ,
5353 " nonebot-adapter-feishu>=2.6.0" ,
5454 " nonebot-adapter-kaiheila>=0.3.4" ,
55+ " nonebot-adapter-mail>=1.0.0a7" ,
5556 " nonebot-adapter-mirai>=2.3.3" ,
5657 " nonebot-adapter-minecraft>=1.3.2" ,
5758 " nonebot-adapter-onebot>=2.4.5" ,
58- " nonebot-adapter-qq>=1.5.3 " ,
59+ " nonebot-adapter-qq>=1.6.2 " ,
5960 " nonebot-adapter-red>=0.9.0" ,
60- " nonebot-adapter-satori>=0.13.0 " ,
61+ " nonebot-adapter-satori>=0.13.4 " ,
6162 " nonebot-adapter-telegram>=0.1.0b18" ,
6263 " nonebot-adapter-kritor>=0.3.2" ,
6364 " nonebot-adapter-tailchat>=0.1.0b12" ,
@@ -67,7 +68,7 @@ dev = [
6768 " pytest-mock>=3.14.0" ,
6869 " nonebot-plugin-localstore>=0.7.1" ,
6970 " pyyaml>=6.0.1" ,
70- " nonebot-adapter-mail>=1.0.0a3 " ,
71+ " fix-future-annotations>=0.5.0 " ,
7172]
7273[tool .pdm .build ]
7374includes = [" src/nonebot_plugin_alconna" ]
@@ -96,8 +97,102 @@ line-length = 120
9697target-version = " py39"
9798
9899[tool .ruff .lint ]
99- select = [" E" , " W" , " F" , " UP" , " C" , " T" , " PYI" , " PT" , " Q" ]
100- ignore = [" C901" , " T201" , " E731" , " E402" , " PT023" ]
100+ select = [
101+ " F" , # pyflakes
102+ " E" , # pycodestyle errors
103+ " W" , # pycodestyle warnings
104+ # "I", # isort
105+ " N" , # PEP8-naming
106+ " UP" , # pyupgrade
107+ " YTT" , # flake8-2020
108+ " ASYNC" , # flake8-async
109+ # "S", # flake8-bandit
110+ " BLE" , # flake8-blind-except
111+ # "FBT", # flake8-boolean-trap
112+ " B" , # flake8-bugbear
113+ " A" , # flake8-builtins
114+ " COM" , # flake8-commas
115+ " C4" , # flake8-comprehensions
116+ " DTZ" , # flake8-datetimez
117+ " T10" , # flake8-debugger
118+ # "FA", # flake8-future-annotations
119+ " ISC" , # flake8-implicit-str-concat
120+ " ICN" , # flake8-import-conventions
121+ " PIE" , # flake8-pie
122+ " T20" , # flake8-print
123+ " PYI" , # flake8-pyi
124+ " Q" , # flake8-quotes
125+ " RSE" , # flake8-raise
126+ " RET" , # flake8-return
127+ " SLOT" , # flake8-slots
128+ " SIM" , # flake8-simplify
129+ " TID" , # flake8-tidy-imports
130+ # "TC", # flake8-type-checking
131+ # "ARG", # flake8-unused-arguments
132+ " PTH" , # flake8-use-pathlib
133+ # "ERA", # eradicate
134+ " PD" , # pandas-vet
135+ " PGH" , # pygrep-hooks
136+ " PL" , # pylint
137+ " TRY" , # tryceratops
138+ " FLY" , # flynt
139+ " FAST" , # FastAPI
140+ " PERF" , # Perflint
141+ " FURB" , # refurb
142+ " RUF" , # Ruff-specific rules
143+ ]
144+ ignore = [
145+ " C901" ,
146+ " T201" ,
147+ " E731" ,
148+ " PT023" ,
149+ " B010" , # Do not call `setattr` with a constant attribute value.
150+ " SIM105" , # Use `contextlib.suppress`
151+ " B008" , # Do not perform function call in argument defaults
152+ " RUF100" , # Unused `noqa` directive
153+ " TC003" , # Move xxx into a type-checking block
154+ " E402" , # module level import not at top of file
155+ " E501" , # 过长的行由 ruff format 处理, 剩余的都是字符串
156+ " UP035" , # pyupgrade, 但 typing.Callable 的导入会报错
157+ " TRY003" ,
158+ " TRY301" , # 为啥非要把 raise 丢进另外一个 inner fn 里
159+ " BLE001" , # except Exception as e
160+ " PGH003" , # 要求 `# type: ignore` 提供理由,但 pyright 和 mypy 等都不是统一标准。
161+ " PLC0414" , # 用 import-as 表示 re-export
162+ " N818" , # 要求所有自定义错误以 Error 作后缀,但我们不这么做
163+ " RET502" , # return = return None
164+ " RET503" , # 就要 implicit return none
165+ " PLC0105" , # 我们已经用 R 表示协变,Q 表示逆变了
166+ " PLR0913" , # 参数就那么多的,你用 builder 什么的不是更逆天?
167+ " SIM108" , # 迫真 simplicy
168+ " RUF001" , # String contains ambiguous `,` (FULLWIDTH COMMA). Did you mean `,` (COMMA)?
169+ " RUF002" , # Docstring contains ambiguous `,` (FULLWIDTH COMMA). Did you mean `,` (COMMA)?
170+ " RUF009" , # 我不想要额外的全局变量。
171+ " UP038" , # instance(..., X | Y) 还是太超前了
172+ " RUF003" , # 中文注释里用全角符号怎么你了
173+ " SLOT000" , # 动态类型需求,主要是 json5 backend
174+ " PLR0911" , " PLR0912" , " PLR0915" , # 复杂度高点怎么你了
175+ " PYI041" , # int 和 float 在运行时的类型没有交集(互不成立 issubclass)
176+ " PLW2901" , # shallow 怎么你了
177+ " S101" , # assert 怎么你了,非要 RuntimeError 吗
178+ " PLR2004" , # magic number 怎么你了
179+ " TRY004" , # 我要抛啥错误我清楚
180+ " COM812" , # 强制尾随逗号
181+ " TID252" , # 相对导入
182+ " ISC001" , # format warning
183+ " N801" , # Class name should use CapWords convention
184+ " N802" , # Function name should be lowercase
185+ " N804" , # First argument of a class method should be named `cls`
186+ " N805" , # First argument of a method should be named `self`
187+ " N806" , # Variable in function should be lowercase
188+ ]
189+ flake8-quotes = { inline-quotes = " double" , multiline-quotes = " double" }
190+
191+ [tool .ruff .lint .flake8-annotations ]
192+ mypy-init-return = true
193+
194+ [tool .ruff .lint .flake8-builtins ]
195+ builtins-ignorelist = [" id" ]
101196
102197[tool .pyright ]
103198pythonVersion = " 3.9"
0 commit comments