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

bump ruff to 0.0.272 and update config #54449

Merged
merged 4 commits into from
Jun 9, 2023

Conversation

SigureMo
Copy link
Member

@SigureMo SigureMo commented Jun 8, 2023

PR types

Others

PR changes

Others

Description

  • 按照 add RFC of introducing ruff community#412 计划升级 Ruff 到 0.0.272(升级后部分 rule (UP031、UP032、B018)检查自动修复力度更高了,因此对相关文件进行了自动修复,少数手动修复)
  • 调整 Ruff 配置,引入全量 PLE rules(比原来只多了零宽字符相关的 PLE2515,可以安全引入)
  • 使用 Ruff F rule 替代 Flake8 F rule,以引入自动修复功能,方便 CINN 合并入 Paddle 之后进行代码规范化
  • Flake8、isort、Ruff 暂时 exclude 掉 CINN 相关目录(见 [WIP] Code merge | Merge CINN into Paddle #54405

PCard-66962

@paddle-bot
Copy link

paddle-bot bot commented Jun 8, 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.

@SigureMo SigureMo changed the title bump ruff to 0.0.271 and update config bump ruff to 0.0.272 and update config Jun 8, 2023
@@ -749,7 +749,7 @@ def max_unpool1d(
This API implements max unpooling 1d opereation.
`max_unpool1d` accepts the output of `max_pool1d` as input,
including the indices of the maximum value and calculate the partial inverse.
All non-maximum values ​​are set to zero.
Copy link
Member Author

Choose a reason for hiding this comment

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

image

所有 API 文档相关修改都是引入的 PLE2515 对零宽字符 "\u200B" 的检测修复导致的,不会影响 API 文档

at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:79)
at org.apache.hadoop.fs.FsShell.main(FsShell.java:2353)
""" # fmt: off, avoid remove tabs in string
Copy link
Member Author

Choose a reason for hiding this comment

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

这个文件之前迁移到 test 下时被格式化掉了,原本前面的 tab 变成了 4 个空格,为了避免再出现类似问题,直接将其替换为等价的 \t

@luotao1 luotao1 merged commit 8f65f72 into PaddlePaddle:develop Jun 9, 2023
@SigureMo SigureMo deleted the ruff/upgrade-271 branch June 9, 2023 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants