-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpyproject.toml
165 lines (142 loc) · 4.9 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
[project]
name = "bilichat-request"
version = "0.2.4"
description = "Default template for PDM package"
authors = [{ name = "Well404", email = "[email protected]" }]
dependencies = [
"playwright>=1.48.0",
"httpx>=0.27.2",
"jinja2>=3.1.4",
"fastapi>=0.115.5",
"loguru>=0.7.2",
"bilireq>=0.2.13",
"sentry-sdk>=2.19.0",
"pypng>=0.20220715.0",
"yarl>=1.18.0",
"uvicorn>=0.32.1",
"pytz>=2024.2",
"python-jose[cryptography]>=3.3.0",
"passlib>=1.7.4",
"python-multipart>=0.0.19",
"pydantic>=2.10.3",
"bcrypt>=4.2.1",
"slowapi>=0.1.9",
"pycryptodomex>=3.21.0",
]
requires-python = ">=3.10,<4.0"
readme = "README.md"
license = { text = "None" }
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
[tool.pdm.build]
includes = ["src/bilichat_request"]
excludes = ["tests/"]
[project.optional-dependencies]
dev = ["nonebot-plugin-htmlrender>=0.4.0", "nonebot2[fastapi]>=2.4.0"]
[tool.pdm]
distribution = true
[tool.ruff]
line-length = 120
exclude = ["tests/"]
[tool.ruff.lint]
select = [
# Flake8 Core Rules
'E', # pycodestyle (Error): 风格错误
'F', # pyflakes: 常见错误
# Flake8 Built-in Plugins
'A', # flake8-builtins: 避免内置名称
'ANN', # flake8-annotations: 类型注解相关
'ARG', # flake8-unused-arguments: 未使用的参数
'ASYNC', # flake8-async: 异步相关
'B', # flake8-bugbear: 常见错误
'C4', # flake8-comprehensions: 推导式相关
'COM', # flake8-commas: 逗号相关
'DJ', # flake8-django: Django 相关
'DTZ', # flake8-datetimez: 日期时间相关
'EXE', # flake8-executable: 可执行文件相关
'FA', # flake8-future-annotations: 未来注解
'FBT', # flake8-boolean-trap: 布尔陷阱
'FIX', # flake8-fixme: FIXME 注释
'G', # flake8-logging-format: 日志格式
'ICN', # flake8-import-conventions: 导入约定
'INT', # flake8-gettext: 国际化相关
'ISC', # flake8-implicit-str-concat: 隐式字符串连接
'LOG', # flake8-logging: 日志相关
'PIE', # flake8-pie: Python 代码改进
'PT', # flake8-pytest-style: Pytest 风格
'PTH', # flake8-use-pathlib: 使用 pathlib
'PYI', # flake8-pyi: 类型注解文件
'Q', # flake8-quotes: 引号使用
'S', # flake8-bandit: 安全性检查
'SIM', # flake8-simplify: 简化代码
'SLOT', # flake8-slots: 使用 __slots__
'T10', # flake8-debugger: 调试器相关
'T20', # flake8-print: 打印语句
'TC', # flake8-type-checking: 类型检查
'YTT', # flake8-2020: Python 版本兼容
# Complexity and Performance
'C90', # mccabe: 复杂度检查
'PERF', # Perflint: 性能优化
# Code Quality and Refactoring
'FURB', # refurb: 代码重构
'TRY', # tryceratops: 异常处理
# Formatting and Code Style
'FLY', # flynt: 字符串格式化
'N', # pep8-naming: 命名约定
# Import Management
'I', # isort: 导入排序
# Framework-Specific Rules
'AIR', # Airflow: Airflow 相关规则
'FAST', # FastAPI: FastAPI 相关
'NPY', # NumPy-specific rules: NumPy 相关
'PD', # pandas-vet: Pandas 相关
# Logging
'G', # flake8-logging-format: 日志格式
'LOG', # flake8-logging: 日志相关
# Miscellaneous Tools
'PL', # Pylint (Convention): Pylint 约定
'PGH', # pygrep-hooks: 预提交钩子
'RUF', # Ruff-specific rules: Ruff 规则
'UP', # pyupgrade: 代码升级
]
ignore = [
# Annotations
"ANN002", # 缺少 *args 的类型注解
"ANN003", # 缺少 **kwargs 的类型注解
"ANN201", # 公共函数缺少返回类型注解
"ANN401", # 缺少类型注解
"PGH003", # 使用 type ignore 注释
# Asynchronous
"ASYNC110", # 事件循环未运行
# Bugbear
"B008", # 不要在参数默认值中执行函数调用
# Complexity
"C901", # 函数过于复杂
"PLR0912", # 分支过多
"PLR0913", # 参数过多
"PLR0915", # 语句过多
# Code Style and Formatting
"COM812", # 更一致的换行方式
"E501", # 行过长
"N815", # 变量名应为小写
# Refactoring and Code Quality
"F841", # 局部变量赋值后未使用
"PLR2004", # 使用了魔法值
"TRY003", # raise 语句不应包含变量
"TRY301", # raise 语句应在 except 块内
"TRY400", # 捕获所有异常
"TRY401", # 捕获多个异常
# Import Management
"ISC001", # 隐式字符串连接
"TC001", # 仅限类型注释的第一方导入
# Performance
"PERF401", # 检查可以用列表推导式替换的 for 循环
# Security
"S101", # 检测到 assert 的使用
"S311", # 标准伪随机生成器不适用于安全/加密目的
"S324", # 使用不安全的 MD5 哈希函数
"S501", # 请求禁用证书验证
# Logging
"G004", # 日志消息中包含变量
]