Skip to content

Commit 4ddd3c1

Browse files
authored
[CodeStyle][Ruff] Bump ruff to version 0.12.0 (#7333)
1 parent a84bd14 commit 4ddd3c1

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ repos:
2626
files: \.md$|\.rst$
2727
# For Python files
2828
- repo: https://github.com/astral-sh/ruff-pre-commit
29-
rev: v0.11.0
29+
rev: v0.12.0
3030
hooks:
31-
- id: ruff
31+
- id: ruff-check
3232
args: [--fix, --exit-non-zero-on-fix, --no-cache]
3333
types_or: [ python, pyi ]
3434
- id: ruff-format

docs/dev_guides/git_guides/codestyle_check_guide_cn.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ Date: xxx
8585
| [Lucas-C/pre-commit-hooks](https://github.com/Lucas-C/pre-commit-hooks.git) | 社区维护的一些通用的 hook,含将 CRLF 改为 LF、移除 Tab 等 hook | 1.5.1 |
8686
| [copyright_checker](https://github.com/PaddlePaddle/Paddle/blob/develop/tools/codestyle/copyright.hook) | Copyright 检查 | 本地脚本 |
8787
| [typos](https://github.com/crate-ci/typos) | 拼写错误检查 | 1.30.2 |
88-
| [black](https://github.com/psf/black) | Python 代码格式化 | 24.8.0 |
89-
| [ruff](https://github.com/astral-sh/ruff) | Python 代码风格检查 | 0.11.0 |
88+
| [black](https://github.com/psf/black) | Python 代码格式化 | 25.1.0 |
89+
| [ruff](https://github.com/astral-sh/ruff) | Python 代码风格检查 | 0.12.0 |
9090
| [clang-format](https://github.com/llvm/llvm-project/tree/main/clang/tools/clang-format) | C++ 代码格式化 | 13.0.0 |
9191
| [cpplint](https://github.com/cpplint/cpplint) | C++ 代码风格检查 | 1.6.0 |
9292
| [clang-tidy](https://github.com/llvm/llvm-project/tree/main/clang-tools-extra/clang-tidy) | C++ 代码风格检查 | 15.0.2.1 |

docs/guides/model_convert/convert_from_pytorch/tools/validate_mapping_files.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -675,8 +675,7 @@ def generate_alias_lines_from_paconvert(basedir, meta_dict) -> None:
675675
output_path = os.path.join(basedir, "alias_macro_lines.tmp.md")
676676
with open(output_path, "w", encoding="utf-8") as f:
677677
od_apis = collections.OrderedDict(sorted(alias_output.items()))
678-
for api, ref in od_apis.items():
679-
f.write(f"| {ref} |\n")
678+
f.writelines(f"| {ref} |\n" for api, ref in od_apis.items())
680679

681680
print(f'generated alias temp file: "{output_path}"')
682681

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ select = [
6565

6666
# Flake8-simplify
6767
"SIM101",
68+
"SIM117",
6869

6970
# Pygrep-hooks
7071
"PGH004",

0 commit comments

Comments
 (0)