Skip to content

Commit cd6d93b

Browse files
committed
🚨 完全使用 ruff 替代 isort 与 black
1 parent 9ea5508 commit cd6d93b

File tree

5 files changed

+765
-693
lines changed

5 files changed

+765
-693
lines changed

.devcontainer/devcontainer.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
"vscode": {
1010
"settings": {
1111
"python.analysis.diagnosticMode": "workspace",
12-
"python.analysis.typeCheckingMode": "basic",
13-
"ruff.organizeImports": false,
12+
"python.analysis.typeCheckingMode": "standard",
13+
"ruff.organizeImports": true,
1414
"[python]": {
15-
"editor.defaultFormatter": "ms-python.black-formatter",
15+
"editor.defaultFormatter": "charliermarsh.ruff",
1616
"editor.codeActionsOnSave": {
1717
"source.fixAll.ruff": true,
1818
"source.organizeImports": true
@@ -44,8 +44,6 @@
4444
"extensions": [
4545
"ms-python.python",
4646
"ms-python.vscode-pylance",
47-
"ms-python.isort",
48-
"ms-python.black-formatter",
4947
"charliermarsh.ruff",
5048
"EditorConfig.EditorConfig",
5149
"esbenp.prettier-vscode"

.pre-commit-config.yaml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,12 @@ ci:
77
autoupdate_commit_msg: ":arrow_up: auto update by pre-commit hooks"
88
repos:
99
- repo: https://github.com/astral-sh/ruff-pre-commit
10-
rev: v0.8.1
10+
rev: v0.8.2
1111
hooks:
1212
- id: ruff
1313
args: [--fix, --exit-non-zero-on-fix]
1414
stages: [pre-commit]
15-
16-
- repo: https://github.com/pycqa/isort
17-
rev: 5.13.2
18-
hooks:
19-
- id: isort
20-
stages: [pre-commit]
21-
22-
- repo: https://github.com/psf/black
23-
rev: 24.10.0
24-
hooks:
25-
- id: black
15+
- id: ruff-format
2616
stages: [pre-commit]
2717

2818
- repo: https://github.com/pre-commit/mirrors-prettier

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,5 +138,5 @@ github = bot.github
138138
生成事件列表:
139139

140140
```bash
141-
python -m codegen && ruff check --fix -e . && isort . && black .
141+
python -m codegen && ruff check --fix -e . && ruff format .
142142
```

0 commit comments

Comments
 (0)