-
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][task 11] enable Ruff F403 rule in python/paddle/base/layers/__init__.py
#57379
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
from . import math_op_patch | ||
from .math_op_patch import * |
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.
这个 PR 可以在 F401 合入后开展,可以考虑一个一个来过 CI,我们首先看一下是否有代码会用这里的重导出,我们可以搜索 base.layers import
,可以发现有几处,但是并不需要 .io
下和 .math_op_patch
下的 symbol,因此这两处重导出都可以直接删掉(应该,但不排除有其他用法)
甚至下面的 from ..layer_helper import LayerHelper
我们也可以规范一下,移除这里的重导出(这里重导出一个上层模块的 symbol 本就是不推荐的),搜索到的 from ...base.layers import LayerHelper
可以改为 from ...base.layer_helper import LayerHelper
可以先尝试改这一个文件,然后看看是否能够通过 CI,之后再改其他文件,慢慢来,F403 本就不是很容易改的,甚至可以考虑拆成多个 PR 慢慢做
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.base.layers.__init__.py
修改已提交
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.
这个 PR 是准备只做这一个文件嘛?是的话可以改一下标题
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.
是的是的,我改一下标题
python/paddle/base/layers/__init__.py
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.
我记得还有个 from .libpaddle import *
来着,下个 PR 记得加 noqa,确保 ruff 扫后无存量
LGTMeow 🐾 本 PR 先行合入,这是 F403 的 part1
"F522", | ||
"F403", |
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.
这里是因为解决冲突写错了?不过 F522 出现概率很小,这两天应该不会出现增量,这个 PR 就这样吧,下个 PR 把 F522 和 F403 一并删掉
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.
是,当时拉取完没改回去🤣,下个pr改回来~
…ers/__init__.py` (PaddlePaddle#57379) * enable F403 * empty * try to fix paddle.base.layers.__init__.py
…ers/__init__.py` (PaddlePaddle#57379) * enable F403 * empty * try to fix paddle.base.layers.__init__.py
PR types
Others
PR changes
Others
Description
enable Ruff F403 rule in python/paddle/base
fix python/paddle/base/layers/init.py
fix python/paddle/nn/functional/pooling.py
@gouzil
paddle.base
check #57367