Loading...
Loading...
Compare original and translation side by side
| Tool | Purpose | Command |
|---|---|---|
| ruff | Lint + format | |
| mypy | Type check | |
| 工具 | 用途 | 命令 |
|---|---|---|
| ruff | 代码检查+格式化 | |
| mypy | 类型检查 | |
[tool.ruff]
line-length = 88
target-version = "py310"
[tool.ruff.lint]
select = ["E", "W", "F", "I", "B", "C4", "UP"][tool.ruff]
line-length = 88
target-version = "py310"
[tool.ruff.lint]
select = ["E", "W", "F", "I", "B", "C4", "UP"][tool.mypy]
python_version = "3.10"
disallow_untyped_defs = true
warn_return_any = true[tool.mypy]
python_version = "3.10"
disallow_untyped_defs = true
warn_return_any = trueundefinedundefined
For protocols and advanced patterns, see **[TYPE_PATTERNS.md](TYPE_PATTERNS.md)**.
如需了解协议和高级模式,请查看 **[TYPE_PATTERNS.md](TYPE_PATTERNS.md)**。undefinedundefined
```python
```pythonundefinedundefinedundefinedundefinedundefinedundefinedsrc/my_library/
├── __init__.py # Public API exports
├── _internal.py # Private (underscore prefix)
├── exceptions.py # Custom exceptions
├── types.py # Type definitions
└── py.typed # Type hint markersrc/my_library/
├── __init__.py # 公开API导出
├── _internal.py # 内部模块(以下划线前缀标识)
├── exceptions.py # 自定义异常
├── types.py # 类型定义
└── py.typed # 类型提示标记Code Quality:
- [ ] ruff check passes
- [ ] mypy passes (strict mode)
- [ ] Public API has type hints
- [ ] Public API has docstrings
- [ ] No mutable default arguments
- [ ] Specific exception handling
- [ ] py.typed marker present代码质量:
- [ ] ruff check 检查通过
- [ ] mypy 检查通过(严格模式)
- [ ] 公开API包含类型提示
- [ ] 公开API包含文档字符串
- [ ] 无可变默认参数
- [ ] 异常处理精准
- [ ] 存在py.typed标记