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][UP010] remove future imports and use ruff to replace ci checks #51772

Merged
merged 1 commit into from
Mar 17, 2023

Conversation

SigureMo
Copy link
Member

@SigureMo SigureMo commented Mar 16, 2023

PR types

Others

PR changes

Others

Describe

移除 #46411 后出现的增量,#46466 虽然已经拦截了但貌似部分漏掉了,本 PR 利用 Ruff UP010 rule 进行存量修复 + 增量拦截,因此可以移除 #46466 增加的相关检测

future 详细说明见:https://docs.python.org/3/library/__future__.html

  • 是否可以引入本 rule:✅ 如上所述,可以引入
  • 是否可引入自动修复:✅ 使用 target-version 选项可控制最低支持版本,目前选项 3.7 与 Paddle 一致,因此移除的 future imports 都是已经内置的特性,该 rules 的自动修复可放心引入

修复所使用的命令如下:

# 安装 ruff 0.0.254
pip install ruff==0.0.254
# 确定本 rule 自动修复方案合适,因此直接使用命令自动修复
ruff --select UP010 . --fix

Related links

@luotao1 luotao1 merged commit 7e6f89c into PaddlePaddle:develop Mar 17, 2023
@SigureMo SigureMo deleted the ruff/fix-and-config/up010 branch March 17, 2023 04:58
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.

2 participants