-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CodeStyle][B015] replace pointless comparisons with appropriate statements #52126
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
assert
or remove it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
emmm,调研不仅包括 rule 本身,还需要考虑对于上下文的理解,这个 rule 本身引入是没问题的,因为确实发现了一些 bug,但是也应该考虑这些语句本身存在的意义,进而使用合适的方案去修复这些 bug
另外标题最好完整一点,delete unused
、rename for
都很难从标题理解这个 PR 做了什么事情
# Conflicts: # pyproject.toml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR types
Bug fixes
PR changes
Others
Describe
都为bug已修复
官方建议:
B015: Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend assert or remove it.
是否可以引入本 rule:✅ 如上所述,可以引入
是否可引入自动修复:❌手动修复
Related links
introducing ruff
community#412