Skip to content
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

Closed

Conversation

KimBioInfoStudio
Copy link
Contributor

@KimBioInfoStudio KimBioInfoStudio commented Mar 26, 2023

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

@paddle-bot
Copy link

paddle-bot bot commented Mar 26, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@SigureMo
Copy link
Member

限制 return 在函数中使用次数 < 6, 重写方法复杂,评估为不适合引入

这个 PR 只是用来说明不适合引入是吗?

@KimBioInfoStudio
Copy link
Contributor Author

限制 return 在函数中使用次数 < 6, 重写方法复杂,评估为不适合引入

这个 PR 只是用来说明不适合引入是吗?

No, u could c some code changes, just becuse ruff scan show the silly code block, so modify it

Copy link
Member

@SigureMo SigureMo left a 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 只会修复这一个是吗?

python/paddle/fluid/tests/unittests/test_cast_op.py Outdated Show resolved Hide resolved
SigureMo
SigureMo previously approved these changes Mar 26, 2023
Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SigureMo
Copy link
Member

PR-CI-Codestyle-Check 需要解决一下,按照流水线内的提示解决即可

@KimBioInfoStudio
Copy link
Contributor Author

PR-CI-Codestyle-Check 需要解决一下,按照流水线内的提示解决即可

Done

@SigureMo
Copy link
Member

看来这个函数已经被 #51749 删掉了,因此这个 PR 先 close 了,如果有其他需要改的可以提新的 PR

@SigureMo SigureMo closed this Mar 27, 2023
@KimBioInfoStudio KimBioInfoStudio deleted the kim/fix_PLR0911 branch March 27, 2023 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants