-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Conversation
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.
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 |
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.
后面的注释删掉就好
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.
done
好的已添加 |
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.
其他地方应该没啥问题,动转静单测可能依赖于语法结构
test/dygraph_to_static/test_error.py
Outdated
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.
这个单测里可能依赖于行号,不太清楚这里 31 行删掉后是否会影响单测结果,可以本地测一下,如果改了的话,需要同步改动行号
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.
这个文件相关位置加 noqa 吧,虽然这些代码貌似没用到,但最好保持转写后代码的原貌
已添加noqa |
python/paddle/base
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.
LGTMeow 🐾
PR types
Others
PR changes
Others
Description
enable Ruff PLR1711 rule in python/paddle/base