# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
exclude: ^\.zed/
repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v6.0.0
    hooks:
      - id: check-added-large-files
      - id: check-executables-have-shebangs
      - id: check-json
      - id: check-shebang-scripts-are-executable
        exclude: '.+\.rs' # would be triggered by #![some_attribute]
      - id: check-symlinks
      - id: check-toml
      - id: check-yaml
        args: [ --allow-multiple-documents ]
      - id: destroyed-symlinks
      - id: end-of-file-fixer
      - id: mixed-line-ending
        args: [ --fix=lf ]
      - id: trailing-whitespace

  - repo: https://github.com/Lucas-C/pre-commit-hooks
    rev: v1.5.6
    hooks:
      - id: forbid-tabs
      - id: remove-tabs

  - repo: local
    hooks:
      - id: cargo-fmt
        name: Rust Format
        description: "Automatically format Rust code with cargo fmt"
        entry: sh -c "cargo fmt --all"
        language: rust
        pass_filenames: false
