repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
  rev: v5.0.0
  hooks:
    - id: check-yaml
    - id: end-of-file-fixer
    - id: trailing-whitespace
    - id: check-ast  # 检查Python语法错误
    - id: debug-statements  # 检查是否有debug语句
- repo: https://github.com/JohnnyMorganz/StyLua
  rev: v2.0.2
  hooks:
    - id: stylua-system # or stylua-system / stylua-github
      files: \.lua$
- repo: https://github.com/doublify/pre-commit-rust
  rev: v1.0
  hooks:
  - id: fmt
    files: \.rs$
  - id: cargo-check
    args: ['--features', 'luajit']
    files: \.rs$
- repo: https://github.com/astral-sh/ruff-pre-commit
  rev: v0.9.9
  hooks:
    # 运行 Ruff linter
    - id: ruff
      args: [--fix]
    # 运行 Ruff formatter
    - id: ruff-format
- repo: https://github.com/RobertCraigie/pyright-python
  rev: v1.1.395
  hooks:
    - id: pyright
      additional_dependencies:
        - "types-setuptools"
        - "types-requests"
