Skip to content

[CodeStyle][Ruff] Introduce rule B005 and fix discovered bugs - #72896

Merged
SigureMo merged 2 commits into
PaddlePaddle:developfrom
gouzil:ruff/add_B005
May 23, 2025
Merged

SigureMo merged 2 commits into
PaddlePaddle:developfrom
gouzil:ruff/add_B005

Conversation

@gouzil

@gouzil gouzil commented May 22, 2025

Copy link
Copy Markdown
Collaborator

PR Category

User Experience

PR Types

Not User Facing

Description

  • 增加 B005 规则,用于明确删除前缀后缀字符串缀意图

Link:

@gouzil
gouzil requested a review from SigureMo as a code owner May 22, 2025 16:38
@paddle-bot

paddle-bot Bot commented May 22, 2025

Copy link
Copy Markdown

你的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.

# TODO (JZ-LIANG) revise this for uniform mixed parallelism
param_name = (
output_name.strip("@GRAD@MERGED")
output_name.removeprefix("@GRAD@MERGED").removesuffix(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

这里 removesuffix 就好,因为老 IR 里这些一定是后缀,或者说这里可以改成

param_name = output_name.removesuffix("@MERGED").removesuffix("@GRAD")

这样就好了,也不用加什么 if

@SigureMo SigureMo mentioned this pull request May 22, 2025
12 of 21 tasks
@paddle-bot paddle-bot Bot added the contributor External developers label May 22, 2025
@SigureMo SigureMo changed the title [CodeStyle][Ruff] add B005 rule [CodeStyle][Ruff] Introduce rule B005 and fix discovered bugs May 23, 2025
@SigureMo

Copy link
Copy Markdown
Collaborator

skip-reason: codestyle only

@SigureMo
SigureMo merged commit 5d76b02 into PaddlePaddle:develop May 23, 2025
@SigureMo
SigureMo deleted the ruff/add_B005 branch May 23, 2025 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants