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][task 3] enable Ruff PLR1711 rule in python/paddle/base #57444

Merged
merged 4 commits into from
Sep 19, 2023

Conversation

zrr1999
Copy link
Member

@zrr1999 zrr1999 commented Sep 18, 2023

PR types

Others

PR changes

Others

Description

enable Ruff PLR1711 rule in python/paddle/base

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.

paddle ❯ ruff . --statistics --select=PLR1711
144     PLR1711 [*] Useless `return` statement at end of function

不止 base 里的哦,非 base 的也需要解决

@@ -70,7 +70,7 @@ select = [
"PLR0206",
"PLR0402",
"PLR1701",
# "PLR1711", # Confirmation required
Copy link
Member

Choose a reason for hiding this comment

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

后面的注释删掉就好

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@zrr1999
Copy link
Member Author

zrr1999 commented Sep 18, 2023

paddle ❯ ruff . --statistics --select=PLR1711
144     PLR1711 [*] Useless `return` statement at end of function

不止 base 里的哦,非 base 的也需要解决

好的已添加

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.

其他地方应该没啥问题,动转静单测可能依赖于语法结构

Copy link
Member

Choose a reason for hiding this comment

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

这个单测里可能依赖于行号,不太清楚这里 31 行删掉后是否会影响单测结果,可以本地测一下,如果改了的话,需要同步改动行号

Copy link
Member

@SigureMo SigureMo Sep 18, 2023

Choose a reason for hiding this comment

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

这个文件相关位置加 noqa 吧,虽然这些代码貌似没用到,但最好保持转写后代码的原貌

@zrr1999
Copy link
Member Author

zrr1999 commented Sep 18, 2023

其他地方应该没啥问题,动转静单测可能依赖于语法结构

已添加noqa

@SigureMo SigureMo changed the title [CodeStyle][task 3] enable Ruff PLR1711 rule in python/paddle/base [CodeStyle][task 3] enable Ruff PLR1711 rule in python/paddle/base Sep 18, 2023
@paddle-bot paddle-bot bot added the contributor External developers label Sep 18, 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.

LGTMeow 🐾

@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Sep 19, 2023
@luotao1 luotao1 merged commit bf06389 into PaddlePaddle:develop Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers HappyOpenSource 快乐开源活动issue与PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants