Skip to content

Commit 9620784

Browse files
authored
[CodeStyle] Bump ruff to 0.2.0 and enable NPY201 (#6495)
1 parent 447dcee commit 9620784

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ repos:
2626
files: \.md$|\.rst$
2727
# For Python files
2828
- repo: https://github.com/astral-sh/ruff-pre-commit
29-
rev: v0.1.13
29+
rev: v0.2.0
3030
hooks:
3131
- id: ruff
3232
args: [--fix, --exit-non-zero-on-fix, --no-cache]

docs/dev_guides/git_guides/codestyle_check_guide_cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Date: xxx
8686
| [copyright_checker](https://github.com/PaddlePaddle/Paddle/blob/develop/tools/codestyle/copyright.hook) | Copyright 检查 | 本地脚本 |
8787
| [black](https://github.com/psf/black) | Python 代码格式化 | 23.3.0 |
8888
| [flake8](https://github.com/PyCQA/flake8) | Python 代码风格检查(即将被 Ruff 完全替换) | 5.0.4 |
89-
| [ruff](https://github.com/astral-sh/ruff) | Python 代码风格检查 | 0.1.5 |
89+
| [ruff](https://github.com/astral-sh/ruff) | Python 代码风格检查 | 0.2.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 |

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ select = [
2626
# NumPy-specific rules
2727
"NPY001",
2828
"NPY003",
29+
"NPY201",
2930

3031
# Bugbear
3132
"B002",

0 commit comments

Comments
 (0)