.pre-commit-config.yaml•1.48 kB
# Pre-commit钩子配置
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: check-docstring-first
- repo: https://github.com/psf/black
rev: 25.9.0
hooks:
- id: black
language_version: python3.10
- repo: https://github.com/pycqa/isort
rev: 7.0.0
hooks:
- id: isort
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.2
hooks:
- id: ruff
args: [--fix, --show-fixes]
- id: ruff-format
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies: [flake8-docstrings]
args: [--max-line-length=88, --extend-ignore=E203,W503]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.18.2
hooks:
- id: mypy
additional_dependencies: [types-requests]
args: [--ignore-missing-imports]
- repo: local
hooks:
- id: pytest-check
name: pytest-check
entry: python -m pytest tests/unit/test_six_tools.py::TestSixToolIntegration::test_all_tools_registered -q
language: system
pass_filenames: false
always_run: false
# 配置选项
default_stages: [commit]
fail_fast: false