apache / apache/cloudstack

Add pre-commit hook `pyupgrade` to auto upgrade Python syntax

未关闭
#10,977 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
long-term-plan
主要语言
Java
星标
3.1k
派生
1.4k
平均合并
6 天 19 小时
30 天内合并 PR
32

描述

"A tool (and pre-commit hook) to automatically upgrade syntax for newer versions of the language."

https://github.com/asottile/pyupgrade

https://github.com/asottile/pyupgrade?tab=readme-ov-file#python2-and-old-python3x-blocks

Example `.pre-commit-config.yaml` entry:

```
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.1
hooks:
- id: pyupgrade
args: [--py37-plus]
```

Availability:

- --py36-plus will remove Python <= 3.5 only blocks
- --py37-plus will remove Python <= 3.6 only blocks
so on and so forth

贡献指南

打开贡献指南

调研方向

检查仓库现有的 .pre-commit-config.yaml,并确定项目使用的 Python 版本策略。添加带有 issue 中适当的 --py37-plus-style 参数的 pyupgrade hook,然后验证 pre-commit 配置接受该参数。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
tooling
Issue 类型
功能
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。