kivy / kivy/python-for-android
Prerequisite.is_valid has unexpected return values.
- 主要语言
- Python
- 星标
- 8.9k
- 派生
- 2k
- 平均合并
- 12 小时 20 分钟
- 30 天内合并 PR
- 9
描述
### Description
The class `Prerequisite` has an `is_valid()` method.
If the prerequisite passes the check, it returns `(True, "")`.
There is no mention what the tuple means, and the only caller (`check_and_install_default_prerequisites`) just cares about its truthiness, anyway. It should just return True.
If the prerequisite fails the check, and is mandatory, an error is logged... and the function falls out without returning a value. It should explicitly return False for clarity, rather than implicitly returning None.
If the prerequisite fails the check, but is not mandatory, a warning is logged... and again the function falls out without returning a value. Given the context (anything returning False is attempted to be installed), I believe this should return True
[This is low priority for me; I am not sure if a PR will follow later, so I am recording it as an issue.]
贡献指南
调研方向
Search for the Prerequisite class and its is_valid() method, then inspect the sole caller, check_and_install_default_prerequisites. Trace each mandatory and optional failure path and verify that the method's return values match the caller's truthiness-based behavior. Done means all paths return explicit boolean values consistently.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- build-system
- Issue 类型
- 缺陷
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 55/100