| repos: | |
| # 通用文件检查 | |
| - repo: https://github.com/pre-commit/pre-commit-hooks | |
| rev: v6.0.0 | |
| hooks: | |
| - id: trailing-whitespace | |
| - id: end-of-file-fixer | |
| - id: check-yaml | |
| - id: check-added-large-files | |
| - id: check-json | |
| - id: check-toml | |
| - id: check-merge-conflict | |
| - id: debug-statements | |
| - id: mixed-line-ending | |
| # 代码检查和格式化 (使用 ruff) | |
| - repo: https://github.com/astral-sh/ruff-pre-commit | |
| rev: v0.14.5 | |
| hooks: | |
| # ruff 代码检查(包括 import 排序) | |
| - id: ruff | |
| args: [--fix, --exit-non-zero-on-fix] | |
| # ruff 代码格式化 | |
| - id: ruff-format | |