-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathsetup.cfg
More file actions
173 lines (139 loc) · 2.74 KB
/
setup.cfg
File metadata and controls
173 lines (139 loc) · 2.74 KB
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
166
167
168
169
170
171
172
173
[flake8]
# Flake8 配置 - Python 代码风格检查
# 最大行长度
max-line-length = 100
# 排除的目录
exclude =
.git,
__pycache__,
.tox,
.eggs,
*.egg,
build,
dist,
venv,
virtualenv,
.venv
# 忽略的错误代码
# E501: 行太长(由 black 处理)
# W503: 二元运算符前换行(与 black 冲突)
ignore =
E501,
W503
# 启用的额外检查
# N: 命名约定
extend-select =
N,
# 每行最大复杂度
max-complexity = 10
# 文档字符串约定
docstring-convention = google
[pylint]
# Pylint 配置 - Python 代码质量分析
[pylint.MASTER]
# 添加初始化文件
init-hook='import sys; sys.path.append(".")'
# 并行作业
jobs=4
[pylint.FORMAT]
# 最大行长度
max-line-length=100
# 期望的缩进字符串
indent-string=' '
[pylint.BASIC]
# 良好的变量名模式
good-names=i,j,k,ex,Run,_
[pylint.DESIGN]
# 最大参数数量
max-args=7
# 最大本地变量数量
max-locals=15
# 最大返回值数量
max-returns=6
# 最大分支数量
max-branches=15
# 最大语句数量
max-statements=50
[pylint.MESSAGE_CONTROL]
# 禁用的警告
disable=
C0111, # 缺少文档字符串
C0103, # 命名风格
R0903, # 类的方法太少
R0913, # 参数太多
W0212, # 访问受保护成员
[mypy]
# MyPy 配置 - Python 类型检查
# 基本选项
python_version = 3.8
warn_return_any = True
warn_unused_configs = True
disallow_untyped_defs = False
# 排除的文件或目录
exclude =
(?x)(
venv/
| virtualenv/
| build/
| dist/
| tests/
)
# 不遵循导入的配置
ignore_missing_imports = True
# 严格模式(可选)
# strict = True
# 显示错误代码
show_error_codes = True
# 显示列号
show_column_numbers = True
[coverage:run]
# Coverage 配置 - 代码覆盖率
# 包含的源代码目录
source = core
# 排除的文件或目录
omit =
*/tests/*
*/test_*.py
*/__pycache__/*
*/site-packages/*
*/venv/*
*/virtualenv/*
setup.py
[coverage:report]
# 覆盖率报告配置
# 精度
precision = 2
# 显示缺失的行
show_missing = True
# 跳过已覆盖的文件
skip_covered = False
# 排除的行
exclude_lines =
pragma: no cover
def __repr__
raise AssertionError
raise NotImplementedError
if __name__ == .__main__.:
if TYPE_CHECKING:
@abstractmethod
[black]
# Black 配置 - Python 代码格式化
# 行长度
line-length = 100
# 目标 Python 版本
target-version = ['py38', 'py39', 'py310', 'py311']
# 包含的文件
include = '\.pyi?$'
# 排除的目录(简化为单行)
exclude =
/\.git/
| /\.hg/
| /\.mypy_cache/
| /\.tox/
| /\.venv/
| /_build/
| /buck-out/
| /build/
| /dist/
| /venv/
| /virtualenv/