Loading...
Loading...
Compare original and translation side by side
pytest-configurationpython-best-practices-fail-fast-importspytest-configurationpython-best-practices-fail-fast-importsundefinedundefined
**Manual Analysis:**
```bash
**手动分析:**
```bash
**See:** [scripts/README.md](./scripts/README.md) for complete automation workflow.
**参考:** [scripts/README.md](./scripts/README.md) 获取完整的自动化工作流。undefinedundefined
**Key flags:**
- `--verbose` - Shows full error context
- `--stats` - Displays error count by category
- No flags - Standard output (recommended for parsing)
**关键参数:**
- `--verbose` - 显示完整的错误上下文
- `--stats` - 按分类显示错误数量
- 无参数 - 标准输出(推荐用于解析)error: Type of "variable" is unknown
error: Return type of function is unknown
error: Parameter "param" type is unknownerror: Argument of type "X" cannot be assigned to parameter "Y"
error: Expression of type "X" cannot be assigned to declared type "Y"
error: Type "X" is not assignable to type "Y"error: "None" is not assignable to "X"
error: Argument of type "X | None" cannot be assigned to parameter "X"
error: Object of type "None" cannot be used as iterable valueerror: Type argument "X" is missing
error: Expected 1 type argument
error: Type "X[Y]" is incompatible with "X[Z]"error: Cannot access member "X" for type "Y"
error: "X" is not a known member of "Y"error: Import "X" could not be resolved
error: Stub file not found for "X"error: Type of "variable" is unknown
error: Return type of function is unknown
error: Parameter "param" type is unknownerror: Argument of type "X" cannot be assigned to parameter "Y"
error: Expression of type "X" cannot be assigned to declared type "Y"
error: Type "X" is not assignable to type "Y"error: "None" is not assignable to "X"
error: Argument of type "X | None" cannot be assigned to parameter "X"
error: Object of type "None" cannot be used as iterable valueerror: Type argument "X" is missing
error: Expected 1 type argument
error: Type "X[Y]" is incompatible with "X[Z]"error: Cannot access member "X" for type "Y"
error: "X" is not a known member of "Y"error: Import "X" could not be resolved
error: Stub file not found for "X"references/reference.mdundefinedreferences/reference.mdundefined
**Pattern 2: Fix Type Mismatches**
```python
**模式2:修复类型不匹配**
```python
**Pattern 3: Handle Optional Types**
```python
**模式3:处理Optional类型**
```python
**Pattern 4: Fix Generic Types**
```python
**模式4:修复泛型类型**
```pythonundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedsrc/application/services/indexing_service.py:45:5 - error: Return type of "process" is unknownundefinedsrc/application/services/indexing_service.py:45:5 - error: Return type of "process" is unknownundefinedundefinedundefinedsrc/infrastructure/neo4j_repository.py:23:9 - error: Argument of type "Settings | None" cannot be assigned to parameter "settings" of type "Settings"undefinedsrc/infrastructure/neo4j_repository.py:23:9 - error: Argument of type "Settings | None" cannot be assigned to parameter "settings" of type "Settings"undefinedundefinedundefinedsrc/domain/entities/chunk.py:12:5 - error: Type argument for "list" is missingundefinedsrc/domain/entities/chunk.py:12:5 - error: Type argument for "list" is missingundefinedundefinedundefinedreferences/reference.md| Error Pattern | Fix Template |
|---|---|
| Add type annotation |
| Add None check with fail-fast |
| Add generic type parameter |
| Check type narrowing/guards |
| Install stub package or add type: ignore |
references/reference.md| 错误模式 | 修复模板 |
|---|---|
| 添加类型注解 |
| 添加None检查并快速失败 |
| 添加泛型类型参数 |
| 检查类型收窄/守卫 |
| 安装存根包或添加type: ignore |
SettingsSettings | NoneServiceResult[T]ServiceResult.failure()list[str]listSettingsSettings | NoneServiceResult[T]ServiceResult.failure()list[str]listuv pip install pyrightpyrightconfig.jsonuv pip install pyrightpyrightconfig.jsonscripts/if not param: raise ValueError()scripts/if not param: raise ValueError()