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][PLC0414] remove self-alias and some discussion #52122

Merged
merged 4 commits into from
Mar 28, 2023

Conversation

Liyulingyue
Copy link
Contributor

@Liyulingyue Liyulingyue commented Mar 24, 2023

PR types

Others

PR changes

Others

Describe

#51729 case 51
ruff rules

PLC0414: Import alias does not rename original package
‘import a as a’ 可以直接记作 ‘import a’,无需通过as的方式进行起一个与原名相同的别名

是否可以引入本 rule:✅ 可引入。
是否可引入自动修复:✅ 可引入。

补充一些无需引入和修改的内容

case 55, PLR0133, 禁止使用常量比较表达式。例如if 2>1: a.append(x)是没有必要的,可以直接写a.append(x)。在paddle中,该现象仅存在于两个文件中python\paddle\fluid\tests\unittests\dygraph_to_static\ifelse_simple_func.py python\paddle\fluid\tests\unittests\dygraph_to_static\test_list.py,这两个文件都是示例文件,应该无需修正。

@paddle-bot
Copy link

paddle-bot bot commented Mar 24, 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.

@paddle-bot paddle-bot bot added contributor External developers status: proposed labels Mar 24, 2023
@Liyulingyue Liyulingyue changed the title [CodeStyle][PLC0414] remove self-alias [CodeStyle][PLC0414] remove self-alias and some discussion Mar 24, 2023
@SigureMo
Copy link
Member

SigureMo commented Mar 25, 2023

emmm 配置又冲突了,我把 pylint 部分配置也改成注释形式的吧,之前没时间调研 pylint 所以没加,稍后我提个相关 PR,这个 PR 可以在那个 PR merge 后再解决冲突

UPDATE:

PR 已提 #52144

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 SigureMo merged commit 888b8b6 into PaddlePaddle:develop Mar 28, 2023
@Liyulingyue Liyulingyue deleted the b007 branch April 6, 2023 13:45
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