-
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][PLR0911] too-many-return-statements #52153
[CodeStyle][PLR0911] too-many-return-statements #52153
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
这个 PR 只是用来说明不适合引入是吗? |
No, u could c some code changes, just becuse ruff scan show the silly code block, so modify 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.
No, u could c some code changes, just becuse ruff scan show the silly code block, so modify it
所以这个 rule 只会修复这一个是吗?
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-CI-Codestyle-Check 需要解决一下,按照流水线内的提示解决即可 |
Done |
看来这个函数已经被 #51749 删掉了,因此这个 PR 先 close 了,如果有其他需要改的可以提新的 PR |
PR types
Others
PR changes
Others
Describe
#51729 61
https://pylint.readthedocs.io/en/latest/user_guide/messages/refactor/too-many-return-statements.html
限制 return 在函数中使用次数 < 6, 重写方法复杂,评估为不适合引入
并部分代码可简化 例https://github.com/PaddlePaddle/Paddle/blob/develop/python/paddle/fluid/tests/unittests/test_cast_op.py#L31