IntuitionX_agent/.pre-commit-config.yaml
2026-01-01 17:48:45 +08:00

41 lines
1.2 KiB
YAML
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

repos:
# 1⃣ 自定义 fullwidth-to-halfwidth 脚本
- repo: local
hooks:
- id: fullwidth-to-halfwidth
name: Convert fullwidth characters to halfwidth
entry: python tools/fullwidth_to_halfwidth_converter.py
language: system
types: [python]
verbose: true
# 3⃣ autopep8 自动格式化
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v2.0.4
hooks:
- id: autopep8
args:
["--in-place", "--aggressive", "--aggressive", "--max-line-length=100"]
# 2⃣ Ruff 检查 & 自动修复
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.4
hooks:
- id: ruff
# 忽略全角字符相关的警告,忽略行长度限制
# args: ["--fix"]
args: ["--fix", "--ignore=RUF001,RUF002,RUF003,RUF022", "--line-length=100"]
# 4⃣ 常用 pre-commit hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-yaml
- id: check-json
- id: check-toml
- id: check-merge-conflict
- id: detect-private-key
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-added-large-files